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

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

Issue 662233002: Web MIDI: make MidiManagerMac notify device connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use enum for MidiPortState Created 5 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
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.h" 5 #include "media/midi/midi_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class FakeMidiManagerClient : public MidiManagerClient { 55 class FakeMidiManagerClient : public MidiManagerClient {
56 public: 56 public:
57 FakeMidiManagerClient() 57 FakeMidiManagerClient()
58 : result_(MIDI_NOT_SUPPORTED), 58 : result_(MIDI_NOT_SUPPORTED),
59 wait_for_result_(true) {} 59 wait_for_result_(true) {}
60 ~FakeMidiManagerClient() override {} 60 ~FakeMidiManagerClient() override {}
61 61
62 // MidiManagerClient implementation. 62 // MidiManagerClient implementation.
63 void AddInputPort(const MidiPortInfo& info) override {} 63 void AddInputPort(const MidiPortInfo& info) override {}
64 void AddOutputPort(const MidiPortInfo& info) override {} 64 void AddOutputPort(const MidiPortInfo& info) override {}
65 void SetInputPortState(uint32 port_index, MidiPortState state) override {}
66 void SetOutputPortState(uint32 port_index, MidiPortState state) override {}
65 67
66 void CompleteStartSession(MidiResult result) override { 68 void CompleteStartSession(MidiResult result) override {
67 EXPECT_TRUE(wait_for_result_); 69 EXPECT_TRUE(wait_for_result_);
68 result_ = result; 70 result_ = result;
69 wait_for_result_ = false; 71 wait_for_result_ = false;
70 } 72 }
71 73
72 void ReceiveMidiData(uint32 port_index, 74 void ReceiveMidiData(uint32 port_index,
73 const uint8* data, 75 const uint8* data,
74 size_t size, 76 size_t size,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Temporary until http://crbug.com/371230 is resolved. 261 // Temporary until http://crbug.com/371230 is resolved.
260 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); 262 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR));
261 #else 263 #else
262 EXPECT_EQ(MIDI_OK, result); 264 EXPECT_EQ(MIDI_OK, result);
263 #endif 265 #endif
264 } 266 }
265 267
266 } // namespace 268 } // namespace
267 269
268 } // namespace media 270 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698