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" |
11 #include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h" | 11 #include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class DidStartSessionTask : public WebMethodTask<MockWebMIDIAccessor> { | 17 class DidStartSessionTask : public WebMethodTask<MockWebMIDIAccessor> { |
18 public: | 18 public: |
19 DidStartSessionTask(MockWebMIDIAccessor* object, | 19 DidStartSessionTask(MockWebMIDIAccessor* object, |
20 blink::WebMIDIAccessorClient* client, | 20 blink::WebMIDIAccessorClient* client, |
21 bool result) | 21 bool result) |
22 : WebMethodTask<MockWebMIDIAccessor>(object), | 22 : WebMethodTask<MockWebMIDIAccessor>(object), |
23 client_(client), | 23 client_(client), |
24 result_(result) {} | 24 result_(result) {} |
25 | 25 |
26 virtual void RunIfValid() override { | 26 void RunIfValid() override { |
27 client_->didStartSession(result_, "InvalidStateError", ""); | 27 client_->didStartSession(result_, "InvalidStateError", ""); |
28 } | 28 } |
29 | 29 |
30 private: | 30 private: |
31 blink::WebMIDIAccessorClient* client_; | 31 blink::WebMIDIAccessorClient* client_; |
32 bool result_; | 32 bool result_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(DidStartSessionTask); | 34 DISALLOW_COPY_AND_ASSIGN(DidStartSessionTask); |
35 }; | 35 }; |
36 | 36 |
(...skipping 18 matching lines...) Expand all Loading... |
55 client_->didAddOutputPort("MockOutputID", | 55 client_->didAddOutputPort("MockOutputID", |
56 "MockOutputManufacturer", | 56 "MockOutputManufacturer", |
57 "MockOutputName", | 57 "MockOutputName", |
58 "MockOutputVersion", | 58 "MockOutputVersion", |
59 active); | 59 active); |
60 interfaces_->GetDelegate()->PostTask(new DidStartSessionTask( | 60 interfaces_->GetDelegate()->PostTask(new DidStartSessionTask( |
61 this, client_, interfaces_->GetTestRunner()->midiAccessorResult())); | 61 this, client_, interfaces_->GetTestRunner()->midiAccessorResult())); |
62 } | 62 } |
63 | 63 |
64 } // namespace content | 64 } // namespace content |
OLD | NEW |