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 "content/shell/renderer/test_runner/mock_web_midi_accessor.h" | 5 #include "content/shell/renderer/test_runner/mock_web_midi_accessor.h" |
6 | 6 |
7 #include "content/shell/renderer/test_runner/test_interfaces.h" | 7 #include "content/shell/renderer/test_runner/test_interfaces.h" |
8 #include "content/shell/renderer/test_runner/test_runner.h" | 8 #include "content/shell/renderer/test_runner/test_runner.h" |
9 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 9 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
10 #include "content/shell/renderer/test_runner/web_test_runner.h" | 10 #include "content/shell/renderer/test_runner/web_test_runner.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, | 39 MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, |
40 TestInterfaces* interfaces) | 40 TestInterfaces* interfaces) |
41 : client_(client), interfaces_(interfaces) { | 41 : client_(client), interfaces_(interfaces) { |
42 } | 42 } |
43 | 43 |
44 MockWebMIDIAccessor::~MockWebMIDIAccessor() { | 44 MockWebMIDIAccessor::~MockWebMIDIAccessor() { |
45 } | 45 } |
46 | 46 |
47 void MockWebMIDIAccessor::startSession() { | 47 void MockWebMIDIAccessor::startSession() { |
48 // Add a mock input and output port. | 48 // Add a mock input and output port. |
49 const bool active = true; | 49 blink::WebMIDIAccessorClient::MIDIPortState state = |
| 50 blink::WebMIDIAccessorClient::MIDIPortStateConnected; |
50 client_->didAddInputPort("MockInputID", | 51 client_->didAddInputPort("MockInputID", |
51 "MockInputManufacturer", | 52 "MockInputManufacturer", |
52 "MockInputName", | 53 "MockInputName", |
53 "MockInputVersion", | 54 "MockInputVersion", |
54 active); | 55 state); |
55 client_->didAddOutputPort("MockOutputID", | 56 client_->didAddOutputPort("MockOutputID", |
56 "MockOutputManufacturer", | 57 "MockOutputManufacturer", |
57 "MockOutputName", | 58 "MockOutputName", |
58 "MockOutputVersion", | 59 "MockOutputVersion", |
59 active); | 60 state); |
60 interfaces_->GetDelegate()->PostTask(new DidStartSessionTask( | 61 interfaces_->GetDelegate()->PostTask(new DidStartSessionTask( |
61 this, client_, interfaces_->GetTestRunner()->midiAccessorResult())); | 62 this, client_, interfaces_->GetTestRunner()->midiAccessorResult())); |
62 } | 63 } |
63 | 64 |
64 } // namespace content | 65 } // namespace content |
OLD | NEW |