aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/http
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-12-28 15:44:25 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-12-28 15:44:25 -0800
commit91031dacb1ff5c57500307044b18c9f929134462 (patch)
tree129cd181da27264258804a2d99a9345ac7fde305 /test/core/http
parentddebfa65f2bdff332902adf73606bc050014b498 (diff)
Changes to exec_ctx/closure/combiner/workqueue interfaces
- make closures know where they should be executed (eg, on a workqueue, or a combiner, or on an exec_ctx) - this allows removal of a large number of trampoline functions that were appearing whenever we used combiners, and should allow for a much easier interface to combiner locks
Diffstat (limited to 'test/core/http')
-rw-r--r--test/core/http/httpcli_test.c18
-rw-r--r--test/core/http/httpscli_test.c18
2 files changed, 22 insertions, 14 deletions
diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c
index 3e312c1dde..4f00cad205 100644
--- a/test/core/http/httpcli_test.c
+++ b/test/core/http/httpcli_test.c
@@ -90,9 +90,10 @@ 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_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_internal_unref(&exec_ctx, resource_quota);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -130,9 +131,11 @@ 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_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_internal_unref(&exec_ctx, resource_quota);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -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);
diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c
index d06035149e..53b26b645f 100644
--- a/test/core/http/httpscli_test.c
+++ b/test/core/http/httpscli_test.c
@@ -91,9 +91,10 @@ 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_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_internal_unref(&exec_ctx, resource_quota);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -132,9 +133,11 @@ 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_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_internal_unref(&exec_ctx, resource_quota);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -210,7 +213,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);