Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: media/midi/midi_message_util_unittest.cc

Issue 1086073004: Web MIDI: namespace change from media to media::midi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@null
Patch Set: (rebase) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/midi/midi_message_util.cc ('k') | media/midi/midi_port_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace media { 9 namespace media {
10 namespace midi {
10 namespace { 11 namespace {
11 12
12 const uint8 kGMOn[] = { 0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7 }; 13 const uint8 kGMOn[] = { 0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7 };
13 const uint8 kNoteOn[] = { 0x90, 0x3c, 0x7f }; 14 const uint8 kNoteOn[] = { 0x90, 0x3c, 0x7f };
14 const uint8 kChannelPressure[] = { 0xd0, 0x01 }; 15 const uint8 kChannelPressure[] = { 0xd0, 0x01 };
15 const uint8 kTimingClock[] = { 0xf8 }; 16 const uint8 kTimingClock[] = { 0xf8 };
16 17
17 TEST(GetMidiMessageLengthTest, BasicTest) { 18 TEST(GetMidiMessageLengthTest, BasicTest) {
18 // Check basic functionarity 19 // Check basic functionarity
19 EXPECT_EQ(arraysize(kNoteOn), GetMidiMessageLength(kNoteOn[0])); 20 EXPECT_EQ(arraysize(kNoteOn), GetMidiMessageLength(kNoteOn[0]));
20 EXPECT_EQ(arraysize(kChannelPressure), 21 EXPECT_EQ(arraysize(kChannelPressure),
21 GetMidiMessageLength(kChannelPressure[0])); 22 GetMidiMessageLength(kChannelPressure[0]));
22 EXPECT_EQ(arraysize(kTimingClock), GetMidiMessageLength(kTimingClock[0])); 23 EXPECT_EQ(arraysize(kTimingClock), GetMidiMessageLength(kTimingClock[0]));
23 24
24 // SysEx message should be mapped to 0-length 25 // SysEx message should be mapped to 0-length
25 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[0])); 26 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[0]));
26 27
27 // Any data byte should be mapped to 0-length 28 // Any data byte should be mapped to 0-length
28 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[1])); 29 EXPECT_EQ(0u, GetMidiMessageLength(kGMOn[1]));
29 EXPECT_EQ(0u, GetMidiMessageLength(kNoteOn[1])); 30 EXPECT_EQ(0u, GetMidiMessageLength(kNoteOn[1]));
30 EXPECT_EQ(0u, GetMidiMessageLength(kChannelPressure[1])); 31 EXPECT_EQ(0u, GetMidiMessageLength(kChannelPressure[1]));
31 } 32 }
32 33
33 } // namespace 34 } // namespace
35 } // namespace midi
34 } // namespace media 36 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_message_util.cc ('k') | media/midi/midi_port_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698