| 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 <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 "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 { | 19 namespace media { |
| 20 namespace midi { | 20 namespace midi { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 template<typename T, size_t N> | 24 template<typename T, size_t N> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class UsbMidiOutputStreamTest : public ::testing::Test { | 58 class UsbMidiOutputStreamTest : public ::testing::Test { |
| 59 protected: | 59 protected: |
| 60 UsbMidiOutputStreamTest() { | 60 UsbMidiOutputStreamTest() { |
| 61 UsbMidiJack jack(&device_, 1, 2, 4); | 61 UsbMidiJack jack(&device_, 1, 2, 4); |
| 62 stream_.reset(new UsbMidiOutputStream(jack)); | 62 stream_.reset(new UsbMidiOutputStream(jack)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 MockUsbMidiDevice device_; | 65 MockUsbMidiDevice device_; |
| 66 scoped_ptr<UsbMidiOutputStream> stream_; | 66 std::unique_ptr<UsbMidiOutputStream> stream_; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(UsbMidiOutputStreamTest); | 69 DISALLOW_COPY_AND_ASSIGN(UsbMidiOutputStreamTest); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 TEST_F(UsbMidiOutputStreamTest, SendEmpty) { | 72 TEST_F(UsbMidiOutputStreamTest, SendEmpty) { |
| 73 stream_->Send(std::vector<uint8_t>()); | 73 stream_->Send(std::vector<uint8_t>()); |
| 74 | 74 |
| 75 EXPECT_EQ("", device_.log()); | 75 EXPECT_EQ("", device_.log()); |
| 76 } | 76 } |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 EXPECT_EQ("0x24 0xf0 0x00 0x01 " | 321 EXPECT_EQ("0x24 0xf0 0x00 0x01 " |
| 322 "0x25 0xf8 0x00 0x00 " | 322 "0x25 0xf8 0x00 0x00 " |
| 323 "0x25 0xfa 0x00 0x00 " | 323 "0x25 0xfa 0x00 0x00 " |
| 324 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); | 324 "0x27 0x02 0x03 0xf7 (endpoint = 4)\n", device_.log()); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace | 327 } // namespace |
| 328 | 328 |
| 329 } // namespace midi | 329 } // namespace midi |
| 330 } // namespace media | 330 } // namespace media |
| OLD | NEW |