summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/api
diff options
context:
space:
mode:
authorjuncai <juncai@chromium.org>2015-07-16 17:07:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-17 00:08:00 +0000
commitc41a003c834c0605e271aa6061b046a776940b86 (patch)
tree270b519fe35009affb85709e4e12bbb0b1e2d739 /extensions/renderer/api
parent628f0c1e9e7faef3bf3acf573aac5cdc82d87261 (diff)
downloadchromium_src-c41a003c834c0605e271aa6061b046a776940b86.zip
chromium_src-c41a003c834c0605e271aa6061b046a776940b86.tar.gz
chromium_src-c41a003c834c0605e271aa6061b046a776940b86.tar.bz2
Add unit tests for new added ReceiveError
This patch added unit tests for new added ReceiveError enums. BUG=414105 Review URL: https://codereview.chromium.org/1242523002 Cr-Commit-Position: refs/heads/master@{#339181}
Diffstat (limited to 'extensions/renderer/api')
-rw-r--r--extensions/renderer/api/serial/serial_api_unittest.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/extensions/renderer/api/serial/serial_api_unittest.cc b/extensions/renderer/api/serial/serial_api_unittest.cc
index 603a2e7..8ba15f0 100644
--- a/extensions/renderer/api/serial/serial_api_unittest.cc
+++ b/extensions/renderer/api/serial/serial_api_unittest.cc
@@ -602,6 +602,36 @@ TEST_F(SerialApiTest, ReceiveErrorDeviceLost) {
RunTest("serial_unittest.js", "testReceiveErrorDeviceLost");
}
+TEST_F(SerialApiTest, ReceiveErrorBreak) {
+ io_handler_ =
+ new ReceiveErrorTestIoHandler(device::serial::RECEIVE_ERROR_BREAK);
+ RunTest("serial_unittest.js", "testReceiveErrorBreak");
+}
+
+TEST_F(SerialApiTest, ReceiveErrorFrameError) {
+ io_handler_ =
+ new ReceiveErrorTestIoHandler(device::serial::RECEIVE_ERROR_FRAME_ERROR);
+ RunTest("serial_unittest.js", "testReceiveErrorFrameError");
+}
+
+TEST_F(SerialApiTest, ReceiveErrorOverrun) {
+ io_handler_ =
+ new ReceiveErrorTestIoHandler(device::serial::RECEIVE_ERROR_OVERRUN);
+ RunTest("serial_unittest.js", "testReceiveErrorOverrun");
+}
+
+TEST_F(SerialApiTest, ReceiveErrorBufferOverflow) {
+ io_handler_ = new ReceiveErrorTestIoHandler(
+ device::serial::RECEIVE_ERROR_BUFFER_OVERFLOW);
+ RunTest("serial_unittest.js", "testReceiveErrorBufferOverflow");
+}
+
+TEST_F(SerialApiTest, ReceiveErrorParityError) {
+ io_handler_ =
+ new ReceiveErrorTestIoHandler(device::serial::RECEIVE_ERROR_PARITY_ERROR);
+ RunTest("serial_unittest.js", "testReceiveErrorParityError");
+}
+
TEST_F(SerialApiTest, ReceiveErrorSystemError) {
io_handler_ =
new ReceiveErrorTestIoHandler(device::serial::RECEIVE_ERROR_SYSTEM_ERROR);