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

Unified Diff: media/midi/midi_manager_usb_unittest.cc

Issue 1052983002: Web MIDI: add MidiScheduler for send() with timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: media/midi/midi_manager_usb_unittest.cc
diff --git a/media/midi/midi_manager_usb_unittest.cc b/media/midi/midi_manager_usb_unittest.cc
index 0afb98b393507a72cefd821bfd23e41ca6a9a322..b699576dd8837b2401575cc156e401b843332a56 100644
--- a/media/midi/midi_manager_usb_unittest.cc
+++ b/media/midi/midi_manager_usb_unittest.cc
@@ -354,12 +354,18 @@ TEST_F(MidiManagerUsbTest, Send) {
ASSERT_EQ(2u, manager_->output_streams().size());
manager_->DispatchSendMidiData(&client, 1, ToVector(data), 0);
+ // Since UsbMidiDevice::Send is posted as a task, RunLoop should run to
+ // invoke the task.
+ // TODO(crbug.com/467442): AccumulateMidiBytesSent is recorded before
+ // UsbMidiDevice is invoked for now, but this should be after the invocation.
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
EXPECT_EQ("UsbMidiDevice::GetDescriptor\n"
+ "MidiManagerClient::AccumulateMidiBytesSent size = 7\n"
"UsbMidiDevice::Send endpoint = 2 data = "
"0x19 0x90 0x45 0x7f "
"0x14 0xf0 0x00 0x01 "
- "0x15 0xf7 0x00 0x00\n"
- "MidiManagerClient::AccumulateMidiBytesSent size = 7\n",
+ "0x15 0xf7 0x00 0x00\n",
logger_.TakeLog());
}

Powered by Google App Engine
This is Rietveld 408576698