@@ -24,7 +24,7 @@ INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()
24
24
});
25
25
26
26
// TestVm is parameterized for each engine and creates a VM on construction.
27
- TEST_P (TestVm, AllowOnRequestHeadersStopIteration ) {
27
+ TEST_P (TestVm, AllowOnHeadersStopIteration ) {
28
28
// Read the wasm source.
29
29
auto source = readTestWasmFile (" stop_iteration.wasm" );
30
30
ASSERT_FALSE (source.empty ());
@@ -47,8 +47,8 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
47
47
// On the root context, call onConfigure().
48
48
ASSERT_TRUE (wasm->configure (root_context, plugin));
49
49
50
- // By default, stream context onRequestHeaders translates
51
- // FilterHeadersStatus::StopIteration to
50
+ // By default, stream context onRequestHeaders and onResponseHeaders
51
+ // translates FilterHeadersStatus::StopIteration to
52
52
// FilterHeadersStatus::StopAllIterationAndWatermark.
53
53
{
54
54
auto wasm_handle = std::make_shared<WasmHandleBase>(wasm);
@@ -57,7 +57,8 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
57
57
stream_context.onCreate ();
58
58
EXPECT_EQ (stream_context.onRequestHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
59
59
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);
61
62
stream_context.onDone ();
62
63
stream_context.onDelete ();
63
64
}
@@ -68,11 +69,12 @@ TEST_P(TestVm, AllowOnRequestHeadersStopIteration) {
68
69
auto wasm_handle = std::make_shared<WasmHandleBase>(wasm);
69
70
auto plugin_handle = std::make_shared<PluginHandleBase>(wasm_handle, plugin);
70
71
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 );
72
73
stream_context.onCreate ();
73
74
EXPECT_EQ (stream_context.onRequestHeaders (/* headers=*/ 0 , /* end_of_stream=*/ false ),
74
75
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);
76
78
stream_context.onDone ();
77
79
stream_context.onDelete ();
78
80
}
0 commit comments