@@ -24,7 +24,7 @@ INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()
2424 });
2525
2626// TestVm is parameterized for each engine and creates a VM on construction.
27- TEST_P (TestVm, AllowOnRequestHeadersStopIteration ) {
27+ TEST_P (TestVm, AllowOnHeadersStopIteration ) {
2828 // Read the wasm source.
2929 auto source = readTestWasmFile (" stop_iteration.wasm" );
3030 ASSERT_FALSE (source.empty ());
@@ -47,8 +47,8 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
4747 // On the root context, call onConfigure().
4848 ASSERT_TRUE (wasm->configure (root_context, plugin));
4949
50- // By default, stream context onRequestHeaders translates
51- // FilterHeadersStatus::StopIteration to
50+ // By default, stream context onRequestHeaders and onResponseHeaders
51+ // translates FilterHeadersStatus::StopIteration to
5252 // FilterHeadersStatus::StopAllIterationAndWatermark.
5353 {
5454 auto wasm_handle = std::make_shared<WasmHandleBase>(wasm);
@@ -57,7 +57,8 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
5757 stream_context.onCreate ();
5858 EXPECT_EQ (stream_context.onRequestHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
5959 FilterHeadersStatus::StopAllIterationAndWatermark);
60- stream_context.onResponseHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false );
60+ EXPECT_EQ (stream_context.onResponseHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
61+ FilterHeadersStatus::StopAllIterationAndWatermark);
6162 stream_context.onDone ();
6263 stream_context.onDelete ();
6364 }
@@ -68,11 +69,12 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
6869 auto wasm_handle = std::make_shared<WasmHandleBase>(wasm);
6970 auto plugin_handle = std::make_shared<PluginHandleBase>(wasm_handle, plugin);
7071 auto stream_context = TestContext (wasm.get (), root_context->id (), plugin_handle);
71- stream_context.set_allow_on_request_headers_stop_iteration (true );
72+ stream_context.set_allow_on_headers_stop_iteration (true );
7273 stream_context.onCreate ();
7374 EXPECT_EQ (stream_context.onRequestHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
7475 FilterHeadersStatus::StopIteration);
75- stream_context.onResponseHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false );
76+ EXPECT_EQ (stream_context.onResponseHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
77+ FilterHeadersStatus::StopIteration);
7678 stream_context.onDone ();
7779 stream_context.onDelete ();
7880 }
0 commit comments