| 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/usb_midi_output_stream.h" | 5 #include "media/midi/usb_midi_output_stream.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "media/midi/usb_midi_device.h" | 16 #include "media/midi/usb_midi_device.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace media { | |
| 20 namespace midi { | 19 namespace midi { |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 template<typename T, size_t N> | 23 template<typename T, size_t N> |
| 25 std::vector<T> ToVector(const T((&array)[N])) { | 24 std::vector<T> ToVector(const T((&array)[N])) { |
| 26 return std::vector<T>(array, array + N); | 25 return std::vector<T>(array, array + N); |
| 27 } | 26 } |
| 28 | 27 |
| 29 class MockUsbMidiDevice : public UsbMidiDevice { | 28 class MockUsbMidiDevice : public UsbMidiDevice { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 stream_->Send(ToVector(data)); | 319 stream_->Send(ToVector(data)); |
| 321 EXPECT_EQ("0x24 0xf0 0x00 0x01 " | 320 EXPECT_EQ("0x24 0xf0 0x00 0x01 " |
| 322 "0x25 0xf8 0x00 0x00 " | 321 "0x25 0xf8 0x00 0x00 " |
| 323 "0x25 0xfa 0x00 0x00 " | 322 "0x25 0xfa 0x00 0x00 " |
| 324 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); | 323 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); |
| 325 } | 324 } |
| 326 | 325 |
| 327 } // namespace | 326 } // namespace |
| 328 | 327 |
| 329 } // namespace midi | 328 } // namespace midi |
| 330 } // namespace media | |
| OLD | NEW |