| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include <sys/wait.h> | 11 #include <sys/wait.h> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/eintr_wrapper.h" | |
| 15 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/posix/eintr_wrapper.h" |
| 16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "chrome/browser/chromeos/process_proxy/process_output_watcher.h" | 18 #include "chrome/browser/chromeos/process_proxy/process_output_watcher.h" |
| 19 | 19 |
| 20 struct TestCase { | 20 struct TestCase { |
| 21 std::string str; | 21 std::string str; |
| 22 bool should_send_terminating_null; | 22 bool should_send_terminating_null; |
| 23 | 23 |
| 24 TestCase(const std::string& expected_string, | 24 TestCase(const std::string& expected_string, |
| 25 bool send_terminating_null) | 25 bool send_terminating_null) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 TEST_F(ProcessOutputWatcherTest, SendNull) { | 158 TEST_F(ProcessOutputWatcherTest, SendNull) { |
| 159 std::vector<TestCase> test_cases; | 159 std::vector<TestCase> test_cases; |
| 160 // This will send '\0' to output wathcer. | 160 // This will send '\0' to output wathcer. |
| 161 test_cases.push_back(TestCase("", true)); | 161 test_cases.push_back(TestCase("", true)); |
| 162 // Let's verify that next input also gets detected (i.e. output watcher does | 162 // Let's verify that next input also gets detected (i.e. output watcher does |
| 163 // not exit after seeing '\0' from previous test case). | 163 // not exit after seeing '\0' from previous test case). |
| 164 test_cases.push_back(TestCase("a", true)); | 164 test_cases.push_back(TestCase("a", true)); |
| 165 | 165 |
| 166 RunTest(test_cases); | 166 RunTest(test_cases); |
| 167 }; | 167 }; |
| OLD | NEW |