OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_message_util.h" | 5 #include "media/midi/midi_message_util.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace media { | |
13 namespace midi { | 12 namespace midi { |
14 namespace { | 13 namespace { |
15 | 14 |
16 const uint8_t kGMOn[] = {0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7}; | 15 const uint8_t kGMOn[] = {0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7}; |
17 const uint8_t kNoteOn[] = {0x90, 0x3c, 0x7f}; | 16 const uint8_t kNoteOn[] = {0x90, 0x3c, 0x7f}; |
18 const uint8_t kSystemCommonMessageReserved1[] = {0xf4}; | 17 const uint8_t kSystemCommonMessageReserved1[] = {0xf4}; |
19 const uint8_t kSystemCommonMessageReserved2[] = {0xf5}; | 18 const uint8_t kSystemCommonMessageReserved2[] = {0xf5}; |
20 const uint8_t kSystemCommonMessageTuneRequest[] = {0xf6}; | 19 const uint8_t kSystemCommonMessageTuneRequest[] = {0xf6}; |
21 const uint8_t kChannelPressure[] = {0xd0, 0x01}; | 20 const uint8_t kChannelPressure[] = {0xd0, 0x01}; |
22 const uint8_t kTimingClock[] = {0xf8}; | 21 const uint8_t kTimingClock[] = {0xf8}; |
(...skipping 15 matching lines...) Expand all Loading... |
38 EXPECT_EQ(0u, GetMidiMessageLength(kSystemCommonMessageReserved2[0])); | 37 EXPECT_EQ(0u, GetMidiMessageLength(kSystemCommonMessageReserved2[0])); |
39 | 38 |
40 // Any data byte should be mapped to 0-length | 39 // Any data byte should be mapped to 0-length |
41 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[1])); | 40 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[1])); |
42 EXPECT_EQ(0u, GetMidiMessageLength(kNoteOn[1])); | 41 EXPECT_EQ(0u, GetMidiMessageLength(kNoteOn[1])); |
43 EXPECT_EQ(0u, GetMidiMessageLength(kChannelPressure[1])); | 42 EXPECT_EQ(0u, GetMidiMessageLength(kChannelPressure[1])); |
44 } | 43 } |
45 | 44 |
46 } // namespace | 45 } // namespace |
47 } // namespace midi | 46 } // namespace midi |
48 } // namespace media | |
OLD | NEW |