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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 ExtensionFunction* FakeSerialConnectFunctionFactory() { | 131 ExtensionFunction* FakeSerialConnectFunctionFactory() { |
132 return new FakeSerialConnectFunction(); | 132 return new FakeSerialConnectFunction(); |
133 } | 133 } |
134 | 134 |
135 void CreateTestSerialServiceOnFileThread( | 135 void CreateTestSerialServiceOnFileThread( |
136 mojo::InterfaceRequest<device::serial::SerialService> request) { | 136 mojo::InterfaceRequest<device::serial::SerialService> request) { |
137 auto io_handler_factory = base::Bind(&FakeEchoSerialIoHandler::Create); | 137 auto io_handler_factory = base::Bind(&FakeEchoSerialIoHandler::Create); |
138 auto* connection_factory = new device::SerialConnectionFactory( | 138 auto* connection_factory = new device::SerialConnectionFactory( |
139 io_handler_factory, content::BrowserThread::GetMessageLoopProxyForThread( | 139 io_handler_factory, content::BrowserThread::GetTaskRunnerForThread( |
140 content::BrowserThread::IO)); | 140 content::BrowserThread::IO)); |
141 std::unique_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( |
(...skipping 46 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 |