| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/shell/data_pipe_peek.h" | 5 #include "mojo/shell/data_pipe_peek.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 11 |
| 9 namespace mojo { | 12 namespace mojo { |
| 10 namespace runner { | 13 namespace runner { |
| 11 namespace { | 14 namespace { |
| 12 | 15 |
| 13 TEST(DataPipePeek, PeekNBytes) { | 16 TEST(DataPipePeek, PeekNBytes) { |
| 14 DataPipe data_pipe; | 17 DataPipe data_pipe; |
| 15 DataPipeConsumerHandle consumer(data_pipe.consumer_handle.get()); | 18 DataPipeConsumerHandle consumer(data_pipe.consumer_handle.get()); |
| 16 DataPipeProducerHandle producer(data_pipe.producer_handle.get()); | 19 DataPipeProducerHandle producer(data_pipe.producer_handle.get()); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // newline terminated string, then peek should fail. | 107 // newline terminated string, then peek should fail. |
| 105 | 108 |
| 106 max_str_length = 3; | 109 max_str_length = 3; |
| 107 EXPECT_FALSE( | 110 EXPECT_FALSE( |
| 108 shell::BlockingPeekLine(consumer, &str, max_str_length, timeout)); | 111 shell::BlockingPeekLine(consumer, &str, max_str_length, timeout)); |
| 109 } | 112 } |
| 110 | 113 |
| 111 } // namespace | 114 } // namespace |
| 112 } // namespace runner | 115 } // namespace runner |
| 113 } // namespace mojo | 116 } // namespace mojo |
| OLD | NEW |