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 <queue> | 5 #include <queue> |
6 | 6 |
7 #include "device/serial/data_sink_receiver.h" | 7 #include "device/serial/data_sink_receiver.h" |
8 #include "device/serial/data_stream.mojom.h" | 8 #include "device/serial/data_stream.mojom.h" |
9 #include "extensions/renderer/api_test_base.h" | 9 #include "extensions/renderer/api_test_base.h" |
10 #include "grit/extensions_renderer_resources.h" | 10 #include "grit/extensions_renderer_resources.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 TEST_F(DataSenderTest, Cancel) { | 154 TEST_F(DataSenderTest, Cancel) { |
155 RunTest("data_sender_unittest.js", "testCancel"); | 155 RunTest("data_sender_unittest.js", "testCancel"); |
156 } | 156 } |
157 | 157 |
158 TEST_F(DataSenderTest, Close) { | 158 TEST_F(DataSenderTest, Close) { |
159 RunTest("data_sender_unittest.js", "testClose"); | 159 RunTest("data_sender_unittest.js", "testClose"); |
160 } | 160 } |
161 | 161 |
| 162 TEST_F(DataSenderTest, SendWithSerialization) { |
| 163 expected_data_.push("aaa"); |
| 164 RunTest("data_sender_unittest.js", "testSendWithSerialization"); |
| 165 } |
| 166 |
| 167 TEST_F(DataSenderTest, SendErrorWithSerialization) { |
| 168 expected_data_.push(""); |
| 169 expected_data_.push("a"); |
| 170 error_to_report_.push(1); |
| 171 expected_data_.push(""); |
| 172 expected_data_.push("c"); |
| 173 error_to_report_.push(0); |
| 174 error_to_report_.push(3); |
| 175 RunTest("data_sender_unittest.js", "testSendErrorWithSerialization"); |
| 176 } |
| 177 |
| 178 TEST_F(DataSenderTest, SendErrorPartialSuccessWithSerialization) { |
| 179 expected_data_.push(std::string(5, 'b')); |
| 180 expected_data_.push("a"); |
| 181 error_to_report_.push(1); |
| 182 expected_data_.push(std::string(5, 'c')); |
| 183 expected_data_.push("d"); |
| 184 error_to_report_.push(0); |
| 185 error_to_report_.push(3); |
| 186 RunTest("data_sender_unittest.js", |
| 187 "testSendErrorPartialSuccessWithSerialization"); |
| 188 } |
| 189 |
| 190 TEST_F(DataSenderTest, SendErrorBetweenPacketsWithSerialization) { |
| 191 expected_data_.push(std::string(2, 'b')); |
| 192 expected_data_.push("a"); |
| 193 error_to_report_.push(1); |
| 194 error_to_report_.push(0); |
| 195 |
| 196 expected_data_.push(std::string(2, 'c')); |
| 197 expected_data_.push("d"); |
| 198 error_to_report_.push(3); |
| 199 RunTest("data_sender_unittest.js", |
| 200 "testSendErrorBetweenPacketsWithSerialization"); |
| 201 } |
| 202 |
| 203 TEST_F(DataSenderTest, SendErrorInSecondPacketWithSerialization) { |
| 204 expected_data_.push(std::string(3, 'b')); |
| 205 expected_data_.push("a"); |
| 206 error_to_report_.push(1); |
| 207 error_to_report_.push(0); |
| 208 expected_data_.push(std::string(3, 'c')); |
| 209 expected_data_.push("d"); |
| 210 error_to_report_.push(3); |
| 211 RunTest("data_sender_unittest.js", |
| 212 "testSendErrorInSecondPacketWithSerialization"); |
| 213 } |
| 214 |
| 215 TEST_F(DataSenderTest, CancelWithSerialization) { |
| 216 RunTest("data_sender_unittest.js", "testCancelWithSerialization"); |
| 217 } |
| 218 |
| 219 TEST_F(DataSenderTest, SerializeWithSendsInProgress) { |
| 220 RunTest("data_sender_unittest.js", "testSerializeWithSendsInProgress"); |
| 221 } |
| 222 |
| 223 TEST_F(DataSenderTest, SerializeWithSendAndCancelInProgress) { |
| 224 RunTest("data_sender_unittest.js", |
| 225 "testSerializeWithSendAndCancelInProgress"); |
| 226 } |
| 227 |
162 } // namespace extensions | 228 } // namespace extensions |
OLD | NEW |