| 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 ~FakeMidiManagerClient() override {} | 60 ~FakeMidiManagerClient() override {} |
| 61 | 61 |
| 62 // MidiManagerClient implementation. | 62 // MidiManagerClient implementation. |
| 63 void AddInputPort(const MidiPortInfo& info) override {} |
| 64 void AddOutputPort(const MidiPortInfo& info) override {} |
| 65 |
| 63 void CompleteStartSession(MidiResult result) override { | 66 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 void ReceiveMidiData(uint32 port_index, | 72 void ReceiveMidiData(uint32 port_index, |
| 70 const uint8* data, | 73 const uint8* data, |
| 71 size_t size, | 74 size_t size, |
| 72 double timestamp) override {} | 75 double timestamp) override {} |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // Temporary until http://crbug.com/371230 is resolved. | 259 // Temporary until http://crbug.com/371230 is resolved. |
| 257 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); | 260 EXPECT_TRUE((result == MIDI_OK) || (result == MIDI_INITIALIZATION_ERROR)); |
| 258 #else | 261 #else |
| 259 EXPECT_EQ(MIDI_OK, result); | 262 EXPECT_EQ(MIDI_OK, result); |
| 260 #endif | 263 #endif |
| 261 } | 264 } |
| 262 | 265 |
| 263 } // namespace | 266 } // namespace |
| 264 | 267 |
| 265 } // namespace media | 268 } // namespace media |
| OLD | NEW |