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 "media/midi/midi_manager_usb.h" | 5 #include "media/midi/midi_manager_usb.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 }; | 217 }; |
218 device->SetDescriptor(ToVector(descriptor)); | 218 device->SetDescriptor(ToVector(descriptor)); |
219 | 219 |
220 Initialize(); | 220 Initialize(); |
221 ScopedVector<UsbMidiDevice> devices; | 221 ScopedVector<UsbMidiDevice> devices; |
222 devices.push_back(device.release()); | 222 devices.push_back(device.release()); |
223 EXPECT_FALSE(IsInitializationCallbackInvoked()); | 223 EXPECT_FALSE(IsInitializationCallbackInvoked()); |
224 RunCallbackUntilCallbackInvoked(true, &devices); | 224 RunCallbackUntilCallbackInvoked(true, &devices); |
225 EXPECT_EQ(MIDI_OK, GetInitializationResult()); | 225 EXPECT_EQ(MIDI_OK, GetInitializationResult()); |
226 | 226 |
227 ASSERT_EQ(1u, manager_->input_ports().size()); | 227 ASSERT_EQ(1u, manager_->get_input_ports().size()); |
228 ASSERT_EQ(2u, manager_->output_ports().size()); | 228 ASSERT_EQ(2u, manager_->get_output_ports().size()); |
229 ASSERT_TRUE(manager_->input_stream()); | 229 ASSERT_TRUE(manager_->input_stream()); |
230 std::vector<UsbMidiInputStream::JackUniqueKey> keys = | 230 std::vector<UsbMidiInputStream::JackUniqueKey> keys = |
231 manager_->input_stream()->RegisteredJackKeysForTesting(); | 231 manager_->input_stream()->RegisteredJackKeysForTesting(); |
232 ASSERT_EQ(2u, manager_->output_streams().size()); | 232 ASSERT_EQ(2u, manager_->output_streams().size()); |
233 EXPECT_EQ(2u, manager_->output_streams()[0]->jack().jack_id); | 233 EXPECT_EQ(2u, manager_->output_streams()[0]->jack().jack_id); |
234 EXPECT_EQ(3u, manager_->output_streams()[1]->jack().jack_id); | 234 EXPECT_EQ(3u, manager_->output_streams()[1]->jack().jack_id); |
235 ASSERT_EQ(1u, keys.size()); | 235 ASSERT_EQ(1u, keys.size()); |
236 EXPECT_EQ(2, keys[0].endpoint_number); | 236 EXPECT_EQ(2, keys[0].endpoint_number); |
237 | 237 |
238 EXPECT_EQ("UsbMidiDevice::GetDescriptor\n", logger_.TakeLog()); | 238 EXPECT_EQ("UsbMidiDevice::GetDescriptor\n", logger_.TakeLog()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 "data = 0x90 0x45 0x7f\n" | 348 "data = 0x90 0x45 0x7f\n" |
349 "MidiManagerClient::ReceiveMidiData port_index = 0 " | 349 "MidiManagerClient::ReceiveMidiData port_index = 0 " |
350 "data = 0xf0 0x00 0x01\n" | 350 "data = 0xf0 0x00 0x01\n" |
351 "MidiManagerClient::ReceiveMidiData port_index = 0 data = 0xf7\n", | 351 "MidiManagerClient::ReceiveMidiData port_index = 0 data = 0xf7\n", |
352 logger_.TakeLog()); | 352 logger_.TakeLog()); |
353 } | 353 } |
354 | 354 |
355 } // namespace | 355 } // namespace |
356 | 356 |
357 } // namespace media | 357 } // namespace media |
OLD | NEW |