| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 481 |
| 482 TEST_F(SerialApiTest, GetInfoFailToGetPortInfo) { | 482 TEST_F(SerialApiTest, GetInfoFailToGetPortInfo) { |
| 483 io_handler_ = new FailToGetInfoTestIoHandler(1); | 483 io_handler_ = new FailToGetInfoTestIoHandler(1); |
| 484 RunTest("serial_unittest.js", "testGetInfoFailToGetPortInfo"); | 484 RunTest("serial_unittest.js", "testGetInfoFailToGetPortInfo"); |
| 485 } | 485 } |
| 486 | 486 |
| 487 TEST_F(SerialApiTest, GetConnections) { | 487 TEST_F(SerialApiTest, GetConnections) { |
| 488 RunTest("serial_unittest.js", "testGetConnections"); | 488 RunTest("serial_unittest.js", "testGetConnections"); |
| 489 } | 489 } |
| 490 | 490 |
| 491 // https://crbug.com/599898 | 491 TEST_F(SerialApiTest, GetControlSignals) { |
| 492 #if defined(LEAK_SANITIZER) | |
| 493 #define MAYBE_GetControlSignals DISABLED_GetControlSignals | |
| 494 #else | |
| 495 #define MAYBE_GetControlSignals GetControlSignals | |
| 496 #endif | |
| 497 TEST_F(SerialApiTest, MAYBE_GetControlSignals) { | |
| 498 io_handler_ = new GetControlSignalsTestIoHandler; | 492 io_handler_ = new GetControlSignalsTestIoHandler; |
| 499 RunTest("serial_unittest.js", "testGetControlSignals"); | 493 RunTest("serial_unittest.js", "testGetControlSignals"); |
| 500 EXPECT_EQ(16u, io_handler_->num_calls()); | 494 EXPECT_EQ(16u, io_handler_->num_calls()); |
| 501 } | 495 } |
| 502 | 496 |
| 503 TEST_F(SerialApiTest, SetControlSignals) { | 497 TEST_F(SerialApiTest, SetControlSignals) { |
| 504 io_handler_ = new SetControlSignalsTestIoHandler; | 498 io_handler_ = new SetControlSignalsTestIoHandler; |
| 505 RunTest("serial_unittest.js", "testSetControlSignals"); | 499 RunTest("serial_unittest.js", "testSetControlSignals"); |
| 506 EXPECT_EQ(9u, io_handler_->num_calls()); | 500 EXPECT_EQ(9u, io_handler_->num_calls()); |
| 507 } | 501 } |
| 508 | 502 |
| 509 // https://crbug.com/599898 | 503 TEST_F(SerialApiTest, Update) { |
| 510 #if defined(LEAK_SANITIZER) | |
| 511 #define MAYBE_Update DISABLED_Update | |
| 512 #else | |
| 513 #define MAYBE_Update Update | |
| 514 #endif | |
| 515 TEST_F(SerialApiTest, MAYBE_Update) { | |
| 516 io_handler_ = new ConfigurePortTestIoHandler; | 504 io_handler_ = new ConfigurePortTestIoHandler; |
| 517 RunTest("serial_unittest.js", "testUpdate"); | 505 RunTest("serial_unittest.js", "testUpdate"); |
| 518 EXPECT_EQ(11u, io_handler_->num_calls()); | 506 EXPECT_EQ(11u, io_handler_->num_calls()); |
| 519 } | 507 } |
| 520 | 508 |
| 521 // https://crbug.com/599898 | 509 TEST_F(SerialApiTest, UpdateAcrossSerialization) { |
| 522 #if defined(LEAK_SANITIZER) | |
| 523 #define MAYBE_UpdateAcrossSerialization DISABLED_UpdateAcrossSerialization | |
| 524 #else | |
| 525 #define MAYBE_UpdateAcrossSerialization UpdateAcrossSerialization | |
| 526 #endif | |
| 527 TEST_F(SerialApiTest, MAYBE_UpdateAcrossSerialization) { | |
| 528 io_handler_ = new ConfigurePortTestIoHandler; | 510 io_handler_ = new ConfigurePortTestIoHandler; |
| 529 RunTest("serial_unittest.js", "testUpdateAcrossSerialization"); | 511 RunTest("serial_unittest.js", "testUpdateAcrossSerialization"); |
| 530 EXPECT_EQ(11u, io_handler_->num_calls()); | 512 EXPECT_EQ(11u, io_handler_->num_calls()); |
| 531 } | 513 } |
| 532 | 514 |
| 533 TEST_F(SerialApiTest, UpdateInvalidBitrate) { | 515 TEST_F(SerialApiTest, UpdateInvalidBitrate) { |
| 534 io_handler_ = new ConfigurePortTestIoHandler; | 516 io_handler_ = new ConfigurePortTestIoHandler; |
| 535 RunTest("serial_unittest.js", "testUpdateInvalidBitrate"); | 517 RunTest("serial_unittest.js", "testUpdateInvalidBitrate"); |
| 536 EXPECT_EQ(1u, io_handler_->num_calls()); | 518 EXPECT_EQ(1u, io_handler_->num_calls()); |
| 537 } | 519 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 io_handler_ = | 694 io_handler_ = |
| 713 new ReceiveErrorTestIoHandler(device::serial::ReceiveError::DEVICE_LOST); | 695 new ReceiveErrorTestIoHandler(device::serial::ReceiveError::DEVICE_LOST); |
| 714 ASSERT_NO_FATAL_FAILURE( | 696 ASSERT_NO_FATAL_FAILURE( |
| 715 RunTest("serial_unittest.js", "testRestoreAndReceiveErrorSetUp")); | 697 RunTest("serial_unittest.js", "testRestoreAndReceiveErrorSetUp")); |
| 716 std::unique_ptr<ModuleSystemTestEnvironment> new_env(CreateEnvironment()); | 698 std::unique_ptr<ModuleSystemTestEnvironment> new_env(CreateEnvironment()); |
| 717 ApiTestEnvironment new_api_test_env(new_env.get()); | 699 ApiTestEnvironment new_api_test_env(new_env.get()); |
| 718 PrepareEnvironment(&new_api_test_env, stash_backend_.get()); | 700 PrepareEnvironment(&new_api_test_env, stash_backend_.get()); |
| 719 new_api_test_env.RunTest("serial_unittest.js", "testRestoreAndReceiveError"); | 701 new_api_test_env.RunTest("serial_unittest.js", "testRestoreAndReceiveError"); |
| 720 } | 702 } |
| 721 | 703 |
| 722 // https://crbug.com/599898 | 704 TEST_F(SerialApiTest, StashAndRestoreNoConnections) { |
| 723 #if defined(LEAK_SANITIZER) | |
| 724 #define MAYBE_StashAndRestoreNoConnections DISABLED_StashAndRestoreNoConnections | |
| 725 #else | |
| 726 #define MAYBE_StashAndRestoreNoConnections StashAndRestoreNoConnections | |
| 727 #endif | |
| 728 TEST_F(SerialApiTest, MAYBE_StashAndRestoreNoConnections) { | |
| 729 ASSERT_NO_FATAL_FAILURE( | 705 ASSERT_NO_FATAL_FAILURE( |
| 730 RunTest("serial_unittest.js", "testStashNoConnections")); | 706 RunTest("serial_unittest.js", "testStashNoConnections")); |
| 731 io_handler_ = nullptr; | 707 io_handler_ = nullptr; |
| 732 std::unique_ptr<ModuleSystemTestEnvironment> new_env(CreateEnvironment()); | 708 std::unique_ptr<ModuleSystemTestEnvironment> new_env(CreateEnvironment()); |
| 733 ApiTestEnvironment new_api_test_env(new_env.get()); | 709 ApiTestEnvironment new_api_test_env(new_env.get()); |
| 734 PrepareEnvironment(&new_api_test_env, stash_backend_.get()); | 710 PrepareEnvironment(&new_api_test_env, stash_backend_.get()); |
| 735 new_api_test_env.RunTest("serial_unittest.js", "testRestoreNoConnections"); | 711 new_api_test_env.RunTest("serial_unittest.js", "testRestoreNoConnections"); |
| 736 } | 712 } |
| 737 | 713 |
| 738 } // namespace extensions | 714 } // namespace extensions |
| OLD | NEW |