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

Unified Diff: media/midi/midi_manager_alsa_unittest.cc

Issue 989913002: Move UdevDecodeString from media/midi to device/udev_linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@seq3
Patch Set: Fix unit tests Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/midi/midi_manager_alsa.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager_alsa_unittest.cc
diff --git a/media/midi/midi_manager_alsa_unittest.cc b/media/midi/midi_manager_alsa_unittest.cc
index 658982745a9bd3e493cd4b7e3fd959e4f7861de1..27248cca67ddfac518766d24314881165a62abdc 100644
--- a/media/midi/midi_manager_alsa_unittest.cc
+++ b/media/midi/midi_manager_alsa_unittest.cc
@@ -8,27 +8,21 @@
namespace media {
-TEST(MidiManagerAlsaTest, UdevEscape) {
- ASSERT_EQ("", MidiManagerAlsa::CardInfo::UnescapeUdev(""));
- ASSERT_EQ("\\", MidiManagerAlsa::CardInfo::UnescapeUdev("\\x5c"));
- ASSERT_EQ("\\x5", MidiManagerAlsa::CardInfo::UnescapeUdev("\\x5"));
- ASSERT_EQ("049f", MidiManagerAlsa::CardInfo::UnescapeUdev("049f"));
- ASSERT_EQ("HD Pro Webcam C920",
- MidiManagerAlsa::CardInfo::UnescapeUdev(
- "HD\\x20Pro\\x20Webcam\\x20C920"));
- ASSERT_EQ("E-MU Systems,Inc.",
- MidiManagerAlsa::CardInfo::UnescapeUdev(
- "E-MU\\x20Systems\\x2cInc."));
-}
-
TEST(MidiManagerAlsaTest, ExtractManufacturer) {
- ASSERT_EQ("My Vendor",
+ ASSERT_EQ("My\\x20Vendor",
MidiManagerAlsa::CardInfo::ExtractManufacturerString(
"My\\x20Vendor",
"1234",
"My Vendor, Inc.",
"Card",
"My Vendor Inc Card at bus"));
+ ASSERT_EQ("My Vendor",
+ MidiManagerAlsa::CardInfo::ExtractManufacturerString(
+ "My Vendor",
+ "1234",
+ "My Vendor, Inc.",
+ "Card",
+ "My Vendor Inc Card at bus"));
ASSERT_EQ("My Vendor, Inc.",
MidiManagerAlsa::CardInfo::ExtractManufacturerString(
"1234",
@@ -56,7 +50,7 @@ TEST(MidiManagerAlsaTest, ExtractManufacturer) {
"",
"Card",
"Longname"));
- ASSERT_EQ("Keystation Mini 32",
+ ASSERT_EQ("Keystation\\x20Mini\\x2032",
MidiManagerAlsa::CardInfo::ExtractManufacturerString(
"Keystation\\x20Mini\\x2032",
"129d",
@@ -66,6 +60,14 @@ TEST(MidiManagerAlsaTest, ExtractManufacturer) {
" usb-0000:00:14.0-2.4.4, full speed"));
ASSERT_EQ("Keystation Mini 32",
MidiManagerAlsa::CardInfo::ExtractManufacturerString(
+ "Keystation Mini 32",
+ "129d",
+ "Evolution Electronics, Ltd",
+ "Keystation Mini 32",
+ "Keystation Mini 32 Keystation Mini 32 at"
+ " usb-0000:00:14.0-2.4.4, full speed"));
+ ASSERT_EQ("Keystation Mini 32",
+ MidiManagerAlsa::CardInfo::ExtractManufacturerString(
"",
"",
"",
« no previous file with comments | « media/midi/midi_manager_alsa.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698