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

Side by Side Diff: content/renderer/media/midi_message_filter_unittest.cc

Issue 2418493002: //media/midi: use top level namespace midi rather than media.midi (Closed)
Patch Set: TAG name change s/media_midi/midi/ Created 4 years, 2 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 | « content/renderer/media/midi_message_filter.cc ('k') | media/midi/BUILD.gn » ('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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "content/renderer/media/midi_message_filter.h" 5 #include "content/renderer/media/midi_message_filter.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 namespace { 12 namespace {
13 using BlinkState = blink::WebMIDIAccessorClient::MIDIPortState; 13 using BlinkState = blink::WebMIDIAccessorClient::MIDIPortState;
14 } // namespace 14 } // namespace
15 15
16 TEST(MidiMessageFilterTest, CastMidiPortState) { 16 TEST(MidiMessageFilterTest, CastMidiPortState) {
17 // Check if static_cast of ToMIDIPortState() just works fine for all states. 17 // Check if static_cast of ToMIDIPortState() just works fine for all states.
18 EXPECT_EQ( 18 EXPECT_EQ(
19 BlinkState::MIDIPortStateDisconnected, 19 BlinkState::MIDIPortStateDisconnected,
20 MidiMessageFilter::ToBlinkState(media::midi::MIDI_PORT_DISCONNECTED)); 20 MidiMessageFilter::ToBlinkState(midi::MIDI_PORT_DISCONNECTED));
21 EXPECT_EQ(BlinkState::MIDIPortStateConnected, 21 EXPECT_EQ(BlinkState::MIDIPortStateConnected,
22 MidiMessageFilter::ToBlinkState(media::midi::MIDI_PORT_CONNECTED)); 22 MidiMessageFilter::ToBlinkState(midi::MIDI_PORT_CONNECTED));
23 // Web MIDI API manages DeviceState and ConnectionState separately. 23 // Web MIDI API manages DeviceState and ConnectionState separately.
24 // "open", "pending", or "closed" are managed separately for ConnectionState 24 // "open", "pending", or "closed" are managed separately for ConnectionState
25 // by Blink per MIDIAccess instance. So, MIDI_PORT_OPENED in content can be 25 // by Blink per MIDIAccess instance. So, MIDI_PORT_OPENED in content can be
26 // converted to MIDIPortStateConnected. 26 // converted to MIDIPortStateConnected.
27 EXPECT_EQ(BlinkState::MIDIPortStateConnected, 27 EXPECT_EQ(BlinkState::MIDIPortStateConnected,
28 MidiMessageFilter::ToBlinkState(media::midi::MIDI_PORT_OPENED)); 28 MidiMessageFilter::ToBlinkState(midi::MIDI_PORT_OPENED));
29 29
30 // Check if we do not have any unknown MidiPortState that is added later. 30 // Check if we do not have any unknown MidiPortState that is added later.
31 EXPECT_EQ(media::midi::MIDI_PORT_OPENED, media::midi::MIDI_PORT_STATE_LAST); 31 EXPECT_EQ(midi::MIDI_PORT_OPENED, midi::MIDI_PORT_STATE_LAST);
32 } 32 }
33 33
34 } // namespace content 34 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/midi_message_filter.cc ('k') | media/midi/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698