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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(DataSenderTest); | 91 DISALLOW_COPY_AND_ASSIGN(DataSenderTest); |
92 }; | 92 }; |
93 | 93 |
94 TEST_F(DataSenderTest, Send) { | 94 TEST_F(DataSenderTest, Send) { |
95 expected_data_.push("aa"); | 95 expected_data_.push("aa"); |
96 RunTest("data_sender_unittest.js", "testSend"); | 96 RunTest("data_sender_unittest.js", "testSend"); |
97 } | 97 } |
98 | 98 |
99 TEST_F(DataSenderTest, LargeSend) { | 99 TEST_F(DataSenderTest, LargeSend) { |
100 std::string pattern = "1234567890"; | 100 std::string pattern = "123"; |
101 std::string expected_data; | 101 std::string expected_data; |
102 for (int i = 0; i < 110; i++) | 102 for (int i = 0; i < 11; i++) |
103 expected_data += pattern; | 103 expected_data += pattern; |
104 expected_data_.push(expected_data); | 104 expected_data_.push(expected_data); |
105 RunTest("data_sender_unittest.js", "testLargeSend"); | 105 RunTest("data_sender_unittest.js", "testLargeSend"); |
106 } | 106 } |
107 | 107 |
108 TEST_F(DataSenderTest, SendError) { | 108 TEST_F(DataSenderTest, SendError) { |
109 expected_data_.push(""); | 109 expected_data_.push(""); |
110 expected_data_.push("a"); | 110 expected_data_.push("a"); |
111 error_to_report_.push(1); | 111 error_to_report_.push(1); |
112 RunTest("data_sender_unittest.js", "testSendError"); | 112 RunTest("data_sender_unittest.js", "testSendError"); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } // namespace extensions | 162 } // namespace extensions |
OLD | NEW |