| 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 "device/serial/serial_device_enumerator.h" | 5 #include "device/serial/serial_device_enumerator.h" |
| 6 #include "device/serial/serial_service_impl.h" | 6 #include "device/serial/serial_service_impl.h" |
| 7 #include "device/serial/test_serial_io_handler.h" | 7 #include "device/serial/test_serial_io_handler.h" |
| 8 #include "extensions/renderer/api_test_base.h" | 8 #include "extensions/renderer/api_test_base.h" |
| 9 #include "grit/extensions_renderer_resources.h" | 9 #include "grit/extensions_renderer_resources.h" |
| 10 | 10 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 }; | 390 }; |
| 391 | 391 |
| 392 } // namespace | 392 } // namespace |
| 393 | 393 |
| 394 class SerialApiTest : public ApiTestBase { | 394 class SerialApiTest : public ApiTestBase { |
| 395 public: | 395 public: |
| 396 SerialApiTest() {} | 396 SerialApiTest() {} |
| 397 | 397 |
| 398 virtual void SetUp() override { | 398 virtual void SetUp() override { |
| 399 ApiTestBase::SetUp(); | 399 ApiTestBase::SetUp(); |
| 400 env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); | |
| 401 env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS); | |
| 402 env()->RegisterModule("data_sender", IDR_DATA_SENDER_JS); | |
| 403 env()->RegisterModule("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS); | 400 env()->RegisterModule("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS); |
| 404 env()->RegisterModule("serial_service", IDR_SERIAL_SERVICE_JS); | |
| 405 env()->RegisterModule("device/serial/data_stream.mojom", | |
| 406 IDR_DATA_STREAM_MOJOM_JS); | |
| 407 env()->RegisterModule("device/serial/data_stream_serialization.mojom", | |
| 408 IDR_DATA_STREAM_SERIALIZATION_MOJOM_JS); | |
| 409 env()->RegisterModule("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS); | |
| 410 env()->RegisterModule("device/serial/serial_serialization.mojom", | |
| 411 IDR_SERIAL_SERIALIZATION_MOJOM_JS); | |
| 412 service_provider()->AddService<device::serial::SerialService>(base::Bind( | 401 service_provider()->AddService<device::serial::SerialService>(base::Bind( |
| 413 &SerialApiTest::CreateSerialService, base::Unretained(this))); | 402 &SerialApiTest::CreateSerialService, base::Unretained(this))); |
| 414 } | 403 } |
| 415 | 404 |
| 416 scoped_refptr<TestIoHandlerBase> io_handler_; | 405 scoped_refptr<TestIoHandlerBase> io_handler_; |
| 417 | 406 |
| 418 private: | 407 private: |
| 419 scoped_refptr<device::SerialIoHandler> GetIoHandler() { | 408 scoped_refptr<device::SerialIoHandler> GetIoHandler() { |
| 420 if (!io_handler_.get()) | 409 if (!io_handler_.get()) |
| 421 io_handler_ = new TestIoHandlerBase; | 410 io_handler_ = new TestIoHandlerBase; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 624 |
| 636 TEST_F(SerialApiTest, SetPausedUnknownConnectionId) { | 625 TEST_F(SerialApiTest, SetPausedUnknownConnectionId) { |
| 637 RunTest("serial_unittest.js", "testSetPausedUnknownConnectionId"); | 626 RunTest("serial_unittest.js", "testSetPausedUnknownConnectionId"); |
| 638 } | 627 } |
| 639 | 628 |
| 640 TEST_F(SerialApiTest, SendUnknownConnectionId) { | 629 TEST_F(SerialApiTest, SendUnknownConnectionId) { |
| 641 RunTest("serial_unittest.js", "testSendUnknownConnectionId"); | 630 RunTest("serial_unittest.js", "testSendUnknownConnectionId"); |
| 642 } | 631 } |
| 643 | 632 |
| 644 } // namespace extensions | 633 } // namespace extensions |
| OLD | NEW |