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

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

Issue 664843002: Web MIDI: distributes MIDIPort information asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifecycle
Patch Set: typo on ipc Created 6 years, 2 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
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 virtual ~FakeMidiManagerClient() {} 60 virtual ~FakeMidiManagerClient() {}
61 61
62 // MidiManagerClient implementation. 62 // MidiManagerClient implementation.
63 virtual void AddInputPort(const MidiPortInfo& info) override {}
64 virtual void AddOutputPort(const MidiPortInfo& info) override {}
65
63 virtual void CompleteStartSession(MidiResult result) override { 66 virtual void CompleteStartSession(MidiResult result) override {
64 EXPECT_TRUE(wait_for_result_); 67 EXPECT_TRUE(wait_for_result_);
65 result_ = result; 68 result_ = result;
66 wait_for_result_ = false; 69 wait_for_result_ = false;
67 } 70 }
68 71
69 virtual void ReceiveMidiData(uint32 port_index, const uint8* data, 72 virtual void ReceiveMidiData(uint32 port_index, const uint8* data,
70 size_t size, double timestamp) override {} 73 size_t size, double timestamp) override {}
71 virtual void AccumulateMidiBytesSent(size_t size) override {} 74 virtual void AccumulateMidiBytesSent(size_t size) override {}
72 75
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Temporary until http://crbug.com/371230 is resolved. 257 // Temporary until http://crbug.com/371230 is resolved.
255 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); 258 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR));
256 #else 259 #else
257 EXPECT_EQ(MIDI_OK, result); 260 EXPECT_EQ(MIDI_OK, result);
258 #endif 261 #endif
259 } 262 }
260 263
261 } // namespace 264 } // namespace
262 265
263 } // namespace media 266 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698