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

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

Issue 1315793008: Web MIDI: introduce MidiManager::Shutdown to shutdown gracefully (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make sure to run Finalize() Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 "media/midi/midi_manager_mac.h" 5 #include "media/midi/midi_manager_mac.h"
6 6
7 #include <CoreMIDI/MIDIServices.h> 7 #include <CoreMIDI/MIDIServices.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 bool unexpected_callback_; 98 bool unexpected_callback_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(FakeMidiManagerClient); 100 DISALLOW_COPY_AND_ASSIGN(FakeMidiManagerClient);
101 }; 101 };
102 102
103 class MidiManagerMacTest : public ::testing::Test { 103 class MidiManagerMacTest : public ::testing::Test {
104 public: 104 public:
105 MidiManagerMacTest() 105 MidiManagerMacTest()
106 : manager_(new MidiManagerMac), 106 : manager_(new MidiManagerMac),
107 message_loop_(new base::MessageLoop) {} 107 message_loop_(new base::MessageLoop) {}
108 ~MidiManagerMacTest() override {
109 manager_->Shutdown();
110 base::RunLoop run_loop;
111 run_loop.RunUntilIdle();
112 }
108 113
109 protected: 114 protected:
110 void StartSession(MidiManagerClient* client) { 115 void StartSession(MidiManagerClient* client) {
111 manager_->StartSession(client); 116 manager_->StartSession(client);
112 } 117 }
113 void EndSession(MidiManagerClient* client) { 118 void EndSession(MidiManagerClient* client) {
114 manager_->EndSession(client); 119 manager_->EndSession(client);
115 } 120 }
116 121
117 private: 122 private:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (ep) 158 if (ep)
154 MIDIEndpointDispose(ep); 159 MIDIEndpointDispose(ep);
155 if (midi_client) 160 if (midi_client)
156 MIDIClientDispose(midi_client); 161 MIDIClientDispose(midi_client);
157 } 162 }
158 163
159 } // namespace 164 } // namespace
160 165
161 } // namespace midi 166 } // namespace midi
162 } // namespace media 167 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698