Lines Matching defs:protocol

48                              SubprocessProtocol protocol);
64 const char* command, SubprocessType type, SubprocessProtocol protocol) {
72 subprocess_fd_ = StartSubprocess(command, nullptr, type, protocol);
111 // Reads shell protocol data from |fd| until it closes or errors. Fills
113 // read from the protocol or -1 if an exit code packet was not received.
119 ShellProtocol* protocol = new ShellProtocol(fd);
120 while (protocol->Read()) {
121 switch (protocol->id()) {
123 stdout->append(protocol->data(), protocol->data_length());
126 stderr->append(protocol->data(), protocol->data_length());
130 EXPECT_EQ(1u, protocol->data_length());
131 exit_code = protocol->data()[0];
134 ADD_FAILURE() << "Unidentified packet ID: " << protocol->id();
137 delete protocol;
171 // Tests a raw subprocess with no protocol.
179 // the shell protocol we should always force a PTY to ensure proper cleanup.
183 // Tests a PTY subprocess with no protocol.
194 // Tests a raw subprocess with the shell protocol.
206 // Tests a PTY subprocess with the shell protocol.
212 // PTY always combines stdout and stderr but the shell protocol should
230 ShellProtocol* protocol = new ShellProtocol(subprocess_fd_);
234 memcpy(protocol->data(), command.data(), command.length());
235 ASSERT_TRUE(protocol->Write(ShellProtocol::kIdStdin, command.length()));
237 delete protocol;
256 ShellProtocol* protocol = new ShellProtocol(subprocess_fd_);
257 memcpy(protocol->data(), input.data(), input.length());
258 ASSERT_TRUE(protocol->Write(ShellProtocol::kIdStdin, input.length()));
259 ASSERT_TRUE(protocol->Write(ShellProtocol::kIdCloseStdin, 0));
260 delete protocol;