| 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 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return new FakeSerialConnectFunction(); | 131 return new FakeSerialConnectFunction(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void CreateTestSerialServiceOnFileThread( | 134 void CreateTestSerialServiceOnFileThread( |
| 135 mojo::InterfaceRequest<device::serial::SerialService> request) { | 135 mojo::InterfaceRequest<device::serial::SerialService> request) { |
| 136 auto io_handler_factory = base::Bind(&FakeEchoSerialIoHandler::Create); | 136 auto io_handler_factory = base::Bind(&FakeEchoSerialIoHandler::Create); |
| 137 auto connection_factory = new device::SerialConnectionFactory( | 137 auto connection_factory = new device::SerialConnectionFactory( |
| 138 io_handler_factory, | 138 io_handler_factory, |
| 139 content::BrowserThread::GetMessageLoopProxyForThread( | 139 content::BrowserThread::GetMessageLoopProxyForThread( |
| 140 content::BrowserThread::IO)); | 140 content::BrowserThread::IO)); |
| 141 scoped_ptr<device::SerialDeviceEnumerator> device_enumerator( | 141 std::unique_ptr<device::SerialDeviceEnumerator> device_enumerator( |
| 142 new FakeSerialDeviceEnumerator); | 142 new FakeSerialDeviceEnumerator); |
| 143 new device::SerialServiceImpl( | 143 new device::SerialServiceImpl( |
| 144 connection_factory, std::move(device_enumerator), std::move(request)); | 144 connection_factory, std::move(device_enumerator), std::move(request)); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void CreateTestSerialService( | 147 void CreateTestSerialService( |
| 148 mojo::InterfaceRequest<device::serial::SerialService> request) { | 148 mojo::InterfaceRequest<device::serial::SerialService> request) { |
| 149 content::BrowserThread::PostTask( | 149 content::BrowserThread::PostTask( |
| 150 content::BrowserThread::FILE, | 150 content::BrowserThread::FILE, |
| 151 FROM_HERE, | 151 FROM_HERE, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 IN_PROC_BROWSER_TEST_P(SerialApiTest, SerialRealHardware) { | 196 IN_PROC_BROWSER_TEST_P(SerialApiTest, SerialRealHardware) { |
| 197 ResultCatcher catcher; | 197 ResultCatcher catcher; |
| 198 catcher.RestrictToBrowserContext(browser()->profile()); | 198 catcher.RestrictToBrowserContext(browser()->profile()); |
| 199 | 199 |
| 200 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_; | 200 ASSERT_TRUE(RunExtensionTest("serial/real_hardware")) << message_; |
| 201 } | 201 } |
| 202 | 202 |
| 203 INSTANTIATE_TEST_CASE_P(SerialApiTest, SerialApiTest, testing::Bool()); | 203 INSTANTIATE_TEST_CASE_P(SerialApiTest, SerialApiTest, testing::Bool()); |
| 204 | 204 |
| 205 } // namespace extensions | 205 } // namespace extensions |
| OLD | NEW |