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

Side by Side Diff: components/test_runner/mock_web_midi_accessor.cc

Issue 2404443002: Web MIDI: use midi_service.mojom for media::midi::Result (Closed)
Patch Set: fix layout test Created 4 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 "components/test_runner/mock_web_midi_accessor.h" 5 #include "components/test_runner/mock_web_midi_accessor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/test_runner/test_interfaces.h" 10 #include "components/test_runner/test_interfaces.h"
(...skipping 24 matching lines...) Expand all
35 client_->didAddOutputPort("MockOutputID", 35 client_->didAddOutputPort("MockOutputID",
36 "MockOutputManufacturer", 36 "MockOutputManufacturer",
37 "MockOutputName", 37 "MockOutputName",
38 "MockOutputVersion", 38 "MockOutputVersion",
39 state); 39 state);
40 interfaces_->GetDelegate()->PostTask(base::Bind( 40 interfaces_->GetDelegate()->PostTask(base::Bind(
41 &MockWebMIDIAccessor::ReportStartedSession, weak_factory_.GetWeakPtr(), 41 &MockWebMIDIAccessor::ReportStartedSession, weak_factory_.GetWeakPtr(),
42 interfaces_->GetTestRunner()->midiAccessorResult())); 42 interfaces_->GetTestRunner()->midiAccessorResult()));
43 } 43 }
44 44
45 void MockWebMIDIAccessor::ReportStartedSession(bool success) { 45 void MockWebMIDIAccessor::ReportStartedSession(media::midi::Result result) {
46 client_->didStartSession(success, "InvalidStateError", ""); 46 client_->didStartSession(result);
47 } 47 }
48 48
49 void MockWebMIDIAccessor::sendMIDIData(unsigned port_index, 49 void MockWebMIDIAccessor::sendMIDIData(unsigned port_index,
50 const unsigned char* data, 50 const unsigned char* data,
51 size_t length, 51 size_t length,
52 double timestamp) { 52 double timestamp) {
53 // Emulate a loopback device for testing. 53 // Emulate a loopback device for testing.
54 client_->didReceiveMIDIData(port_index, data, length, timestamp); 54 client_->didReceiveMIDIData(port_index, data, length, timestamp);
55 } 55 }
56 56
57 } // namespace test_runner 57 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698