| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "device/serial/serial_device_enumerator.h" | 9 #include "device/serial/serial_device_enumerator.h" |
| 10 #include "device/serial/serial_service_impl.h" | 10 #include "device/serial/serial_service_impl.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 MOCK_METHOD1(SetControlSignals, | 76 MOCK_METHOD1(SetControlSignals, |
| 77 bool(const device::serial::HostControlSignals&)); | 77 bool(const device::serial::HostControlSignals&)); |
| 78 | 78 |
| 79 protected: | 79 protected: |
| 80 ~FakeEchoSerialIoHandler() override {} | 80 ~FakeEchoSerialIoHandler() override {} |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(FakeEchoSerialIoHandler); | 83 DISALLOW_COPY_AND_ASSIGN(FakeEchoSerialIoHandler); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class FakeSerialConnectFunction : public core_api::SerialConnectFunction { | 86 class FakeSerialConnectFunction : public api::SerialConnectFunction { |
| 87 protected: | 87 protected: |
| 88 SerialConnection* CreateSerialConnection( | 88 SerialConnection* CreateSerialConnection( |
| 89 const std::string& port, | 89 const std::string& port, |
| 90 const std::string& owner_extension_id) const override { | 90 const std::string& owner_extension_id) const override { |
| 91 scoped_refptr<FakeEchoSerialIoHandler> io_handler = | 91 scoped_refptr<FakeEchoSerialIoHandler> io_handler = |
| 92 new FakeEchoSerialIoHandler; | 92 new FakeEchoSerialIoHandler; |
| 93 SerialConnection* serial_connection = | 93 SerialConnection* serial_connection = |
| 94 new SerialConnection(port, owner_extension_id); | 94 new SerialConnection(port, owner_extension_id); |
| 95 serial_connection->SetIoHandlerForTest(io_handler); | 95 serial_connection->SetIoHandlerForTest(io_handler); |
| 96 return serial_connection; | 96 return serial_connection; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 IN_PROC_BROWSER_TEST_P(SerialApiTest, SerialRealHardware) { | 194 IN_PROC_BROWSER_TEST_P(SerialApiTest, SerialRealHardware) { |
| 195 ResultCatcher catcher; | 195 ResultCatcher catcher; |
| 196 catcher.RestrictToBrowserContext(browser()->profile()); | 196 catcher.RestrictToBrowserContext(browser()->profile()); |
| 197 | 197 |
| 198 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_; | 198 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_; |
| 199 } | 199 } |
| 200 | 200 |
| 201 INSTANTIATE_TEST_CASE_P(SerialApiTest, SerialApiTest, testing::Bool()); | 201 INSTANTIATE_TEST_CASE_P(SerialApiTest, SerialApiTest, testing::Bool()); |
| 202 | 202 |
| 203 } // namespace extensions | 203 } // namespace extensions |
| OLD | NEW |