| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |