| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } // namespace | 301 } // namespace |
| 302 | 302 |
| 303 class SerialApiTest : public ApiTestBase { | 303 class SerialApiTest : public ApiTestBase { |
| 304 public: | 304 public: |
| 305 SerialApiTest() {} | 305 SerialApiTest() {} |
| 306 | 306 |
| 307 virtual void SetUp() OVERRIDE { | 307 virtual void SetUp() OVERRIDE { |
| 308 ApiTestBase::SetUp(); | 308 ApiTestBase::SetUp(); |
| 309 env()->RegisterModule("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS); | 309 env()->RegisterModule("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS); |
| 310 env()->RegisterModule("serial_service", IDR_SERIAL_SERVICE_JS); | 310 env()->RegisterModule("serial_service", IDR_SERIAL_SERVICE_JS); |
| 311 env()->RegisterModule("device/serial/data_stream.mojom", |
| 312 IDR_DATA_STREAM_MOJOM_JS); |
| 311 env()->RegisterModule("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS); | 313 env()->RegisterModule("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS); |
| 312 service_provider()->AddService<device::serial::SerialService>(base::Bind( | 314 service_provider()->AddService<device::serial::SerialService>(base::Bind( |
| 313 &SerialApiTest::CreateSerialService, base::Unretained(this))); | 315 &SerialApiTest::CreateSerialService, base::Unretained(this))); |
| 314 } | 316 } |
| 315 | 317 |
| 316 virtual void TearDown() OVERRIDE { | 318 virtual void TearDown() OVERRIDE { |
| 317 if (io_handler_) | 319 if (io_handler_) |
| 318 EXPECT_TRUE(io_handler_->HasOneRef()); | 320 EXPECT_TRUE(io_handler_->HasOneRef()); |
| 319 ApiTestBase::TearDown(); | 321 ApiTestBase::TearDown(); |
| 320 } | 322 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 440 |
| 439 TEST_F(SerialApiTest, FlushUnknownConnectionId) { | 441 TEST_F(SerialApiTest, FlushUnknownConnectionId) { |
| 440 RunTest("serial_unittest.js", "testFlushUnknownConnectionId"); | 442 RunTest("serial_unittest.js", "testFlushUnknownConnectionId"); |
| 441 } | 443 } |
| 442 | 444 |
| 443 TEST_F(SerialApiTest, SetPausedUnknownConnectionId) { | 445 TEST_F(SerialApiTest, SetPausedUnknownConnectionId) { |
| 444 RunTest("serial_unittest.js", "testSetPausedUnknownConnectionId"); | 446 RunTest("serial_unittest.js", "testSetPausedUnknownConnectionId"); |
| 445 } | 447 } |
| 446 | 448 |
| 447 } // namespace extensions | 449 } // namespace extensions |
| OLD | NEW |