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

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

Issue 2673423002: Web MIDI: add dynamic MidiManager instantiation support for Linux (Closed)
Patch Set: rebase again Created 3 years, 10 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_manager_usb.cc ('k') | media/midi/midi_manager_win.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_manager_usb.h" 5 #include "media/midi/midi_manager_usb.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Callback callback_; 163 Callback callback_;
164 164
165 private: 165 private:
166 DISALLOW_COPY_AND_ASSIGN(TestUsbMidiDeviceFactory); 166 DISALLOW_COPY_AND_ASSIGN(TestUsbMidiDeviceFactory);
167 }; 167 };
168 168
169 class MidiManagerUsbForTesting : public MidiManagerUsb { 169 class MidiManagerUsbForTesting : public MidiManagerUsb {
170 public: 170 public:
171 explicit MidiManagerUsbForTesting( 171 explicit MidiManagerUsbForTesting(
172 std::unique_ptr<UsbMidiDevice::Factory> device_factory) 172 std::unique_ptr<UsbMidiDevice::Factory> device_factory)
173 : MidiManagerUsb(std::move(device_factory)) {} 173 : MidiManagerUsb(nullptr, std::move(device_factory)) {}
174 ~MidiManagerUsbForTesting() override {} 174 ~MidiManagerUsbForTesting() override {}
175 175
176 void CallCompleteInitialization(Result result) { 176 void CallCompleteInitialization(Result result) {
177 CompleteInitialization(result); 177 CompleteInitialization(result);
178 base::RunLoop run_loop; 178 base::RunLoop run_loop;
179 run_loop.RunUntilIdle(); 179 run_loop.RunUntilIdle();
180 } 180 }
181 181
182 private: 182 private:
183 DISALLOW_COPY_AND_ASSIGN(MidiManagerUsbForTesting); 183 DISALLOW_COPY_AND_ASSIGN(MidiManagerUsbForTesting);
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 EXPECT_EQ(2u, manager_->output_streams()[0]->jack().jack_id); 569 EXPECT_EQ(2u, manager_->output_streams()[0]->jack().jack_id);
570 EXPECT_EQ(3u, manager_->output_streams()[1]->jack().jack_id); 570 EXPECT_EQ(3u, manager_->output_streams()[1]->jack().jack_id);
571 ASSERT_EQ(1u, jacks.size()); 571 ASSERT_EQ(1u, jacks.size());
572 EXPECT_EQ(2, jacks[0].endpoint_number()); 572 EXPECT_EQ(2, jacks[0].endpoint_number());
573 EXPECT_EQ("UsbMidiDevice::GetDescriptors\n", logger_.TakeLog()); 573 EXPECT_EQ("UsbMidiDevice::GetDescriptors\n", logger_.TakeLog());
574 } 574 }
575 575
576 } // namespace 576 } // namespace
577 577
578 } // namespace midi 578 } // namespace midi
OLDNEW
« no previous file with comments | « media/midi/midi_manager_usb.cc ('k') | media/midi/midi_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698