| 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_input_stream.h" | 5 #include "media/midi/usb_midi_input_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 <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "media/midi/usb_midi_device.h" | 17 #include "media/midi/usb_midi_device.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using base::TimeTicks; | 20 using base::TimeTicks; |
| 21 | 21 |
| 22 namespace media { | 22 namespace media { |
| 23 namespace midi { | 23 namespace midi { |
| 24 | 24 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 135)); | 79 135)); |
| 80 stream_->Add(UsbMidiJack(&device1_, | 80 stream_->Add(UsbMidiJack(&device1_, |
| 81 85, | 81 85, |
| 82 5, | 82 5, |
| 83 135)); | 83 135)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 TestUsbMidiDevice device1_; | 86 TestUsbMidiDevice device1_; |
| 87 TestUsbMidiDevice device2_; | 87 TestUsbMidiDevice device2_; |
| 88 MockDelegate delegate_; | 88 MockDelegate delegate_; |
| 89 scoped_ptr<UsbMidiInputStream> stream_; | 89 std::unique_ptr<UsbMidiInputStream> stream_; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 DISALLOW_COPY_AND_ASSIGN(UsbMidiInputStreamTest); | 92 DISALLOW_COPY_AND_ASSIGN(UsbMidiInputStreamTest); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 TEST_F(UsbMidiInputStreamTest, UnknownMessage) { | 95 TEST_F(UsbMidiInputStreamTest, UnknownMessage) { |
| 96 uint8_t data[] = { | 96 uint8_t data[] = { |
| 97 0x40, 0xff, 0xff, 0xff, 0x41, 0xff, 0xff, 0xff, | 97 0x40, 0xff, 0xff, 0xff, 0x41, 0xff, 0xff, 0xff, |
| 98 }; | 98 }; |
| 99 | 99 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 uint8_t data[] = {0x4f, 0xf8, 0x00, 0x00}; | 164 uint8_t data[] = {0x4f, 0xf8, 0x00, 0x00}; |
| 165 | 165 |
| 166 stream_->OnReceivedData(&device2_, 7, data, arraysize(data), TimeTicks()); | 166 stream_->OnReceivedData(&device2_, 7, data, arraysize(data), TimeTicks()); |
| 167 EXPECT_EQ("0xf8 \n", delegate_.received_data()); | 167 EXPECT_EQ("0xf8 \n", delegate_.received_data()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace | 170 } // namespace |
| 171 | 171 |
| 172 } // namespace midi | 172 } // namespace midi |
| 173 } // namespace media | 173 } // namespace media |
| OLD | NEW |