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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "media/midi/usb_midi_device.h" | 12 #include "media/midi/usb_midi_device.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
| 16 namespace midi { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 template<typename T, size_t N> | 20 template<typename T, size_t N> |
20 std::vector<T> ToVector(const T((&array)[N])) { | 21 std::vector<T> ToVector(const T((&array)[N])) { |
21 return std::vector<T>(array, array + N); | 22 return std::vector<T>(array, array + N); |
22 } | 23 } |
23 | 24 |
24 class MockUsbMidiDevice : public UsbMidiDevice { | 25 class MockUsbMidiDevice : public UsbMidiDevice { |
25 public: | 26 public: |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 267 |
267 stream_->Send(ToVector(data)); | 268 stream_->Send(ToVector(data)); |
268 EXPECT_EQ("0x24 0xf0 0x00 0x01 " | 269 EXPECT_EQ("0x24 0xf0 0x00 0x01 " |
269 "0x25 0xf8 0x00 0x00 " | 270 "0x25 0xf8 0x00 0x00 " |
270 "0x25 0xfa 0x00 0x00 " | 271 "0x25 0xfa 0x00 0x00 " |
271 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); | 272 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); |
272 } | 273 } |
273 | 274 |
274 } // namespace | 275 } // namespace |
275 | 276 |
| 277 } // namespace midi |
276 } // namespace media | 278 } // namespace media |
OLD | NEW |