• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 //
3 // Copyright 2024 gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //
18 
19 #include "src/core/ext/transport/chttp2/transport/http2_server_transport.h"
20 
21 #include <gtest/gtest.h>
22 
23 #include "src/core/lib/event_engine/default_event_engine.h"
24 #include "test/core/transport/util/mock_promise_endpoint.h"
25 
26 using grpc_core::chaotic_good::testing::MockPromiseEndpoint;
27 using grpc_event_engine::experimental::EventEngine;
28 
29 namespace grpc_core {
30 namespace http2 {
31 namespace testing {
32 
TEST(Http2ClientTransportTest,TestHttp2ServerTransportObjectCreation)33 TEST(Http2ClientTransportTest, TestHttp2ServerTransportObjectCreation) {
34   MockPromiseEndpoint endpoint(1);
35   std::shared_ptr<EventEngine> event_engine =
36       grpc_event_engine::experimental::GetDefaultEventEngine();
37 
38   Http2ServerTransport transport(std::move(endpoint.promise_endpoint),
39                                  CoreConfiguration::Get()
40                                      .channel_args_preconditioning()
41                                      .PreconditionChannelArgs(nullptr),
42                                  event_engine);
43 }
44 
45 }  // namespace testing
46 }  // namespace http2
47 }  // namespace grpc_core
48 
main(int argc,char ** argv)49 int main(int argc, char** argv) {
50   ::testing::InitGoogleTest(&argc, argv);
51   // Must call to create default EventEngine.
52   grpc_init();
53   int ret = RUN_ALL_TESTS();
54   grpc_shutdown();
55   return ret;
56 }
57