OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // must be below this, because the server does not begin dequeueing request | 689 // must be below this, because the server does not begin dequeueing request |
690 // messages until the client has finished sending them. | 690 // messages until the client has finished sending them. |
691 // | 691 // |
692 // The queue limit on new ports has been seen to be below | 692 // The queue limit on new ports has been seen to be below |
693 // MACH_PORT_QLIMIT_DEFAULT, so it will explicitly be set by | 693 // MACH_PORT_QLIMIT_DEFAULT, so it will explicitly be set by |
694 // mach_port_set_attributes() for this test. This needs to happen before the | 694 // mach_port_set_attributes() for this test. This needs to happen before the |
695 // child is allowed to begin sending messages, so | 695 // child is allowed to begin sending messages, so |
696 // child_wait_for_parent_pipe_early is used to make the child wait until the | 696 // child_wait_for_parent_pipe_early is used to make the child wait until the |
697 // parent is ready. | 697 // parent is ready. |
698 const size_t kTransactionCount = 4; | 698 const size_t kTransactionCount = 4; |
699 COMPILE_ASSERT(kTransactionCount <= MACH_PORT_QLIMIT_DEFAULT, | 699 static_assert(kTransactionCount <= MACH_PORT_QLIMIT_DEFAULT, |
700 must_not_exceed_queue_limit); | 700 "must not exceed queue limit"); |
701 | 701 |
702 TestMachMessageServer::Options options; | 702 TestMachMessageServer::Options options; |
703 options.parent_wait_for_child_pipe = true; | 703 options.parent_wait_for_child_pipe = true; |
704 options.server_persistent = MachMessageServer::kPersistent; | 704 options.server_persistent = MachMessageServer::kPersistent; |
705 options.server_nonblocking = MachMessageServer::kNonblocking; | 705 options.server_nonblocking = MachMessageServer::kNonblocking; |
706 options.expect_server_result = MACH_RCV_TIMED_OUT; | 706 options.expect_server_result = MACH_RCV_TIMED_OUT; |
707 options.expect_server_transaction_count = kTransactionCount; | 707 options.expect_server_transaction_count = kTransactionCount; |
708 options.child_wait_for_parent_pipe_early = true; | 708 options.child_wait_for_parent_pipe_early = true; |
709 options.client_send_request_count = kTransactionCount; | 709 options.client_send_request_count = kTransactionCount; |
710 options.child_send_all_requests_before_receiving_any_replies = true; | 710 options.child_send_all_requests_before_receiving_any_replies = true; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // so a new buffer is allocated to receive the message. The server receives | 838 // so a new buffer is allocated to receive the message. The server receives |
839 // the large request message, processes it, and returns a reply to the client. | 839 // the large request message, processes it, and returns a reply to the client. |
840 TestMachMessageServer::Options options; | 840 TestMachMessageServer::Options options; |
841 options.server_options = MACH_RCV_LARGE; | 841 options.server_options = MACH_RCV_LARGE; |
842 options.client_send_large = true; | 842 options.client_send_large = true; |
843 TestMachMessageServer test_mach_message_server(options); | 843 TestMachMessageServer test_mach_message_server(options); |
844 test_mach_message_server.Test(); | 844 test_mach_message_server.Test(); |
845 } | 845 } |
846 | 846 |
847 } // namespace | 847 } // namespace |
OLD | NEW |