aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/http/httpcli_test.c
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-02-08 15:27:31 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-02-08 15:27:31 -0800
commitacbc5dd6ece72a1eb1032568a0061ef867b8b800 (patch)
treed991968fe7c2bf8154bef1b798b89bda68dd5719 /test/core/http/httpcli_test.c
parent40d7c627bde4c08d40568f62e6f284a6a615fb71 (diff)
parentda7b06c2f8d0dd89ab92589c55d5233f329083c5 (diff)
Merge remote-tracking branch 'upstream/master' into packet-coalescing-objc
Diffstat (limited to 'test/core/http/httpcli_test.c')
-rw-r--r--test/core/http/httpcli_test.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c
index 3e312c1dde..6cc00f871d 100644
--- a/test/core/http/httpcli_test.c
+++ b/test/core/http/httpcli_test.c
@@ -51,7 +51,7 @@ static gpr_mu *g_mu;
static grpc_polling_entity g_pops;
static gpr_timespec n_seconds_time(int seconds) {
- return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds);
+ return grpc_timeout_seconds_to_deadline(seconds);
}
static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
@@ -90,10 +90,11 @@ static void test_get(int port) {
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), &response);
- grpc_resource_quota_internal_unref(&exec_ctx, resource_quota);
+ 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;
@@ -130,10 +131,12 @@ static void test_post(int port) {
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), &response);
- grpc_resource_quota_internal_unref(&exec_ctx, resource_quota);
+ 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;
@@ -207,7 +210,8 @@ int main(int argc, char **argv) {
test_post(port);
grpc_httpcli_context_destroy(&g_context);
- grpc_closure_init(&destroyed, destroy_pops, &g_pops);
+ 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);