| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/MockWebMIDIAccessor.h" | 5 #include "content/shell/renderer/test_runner/MockWebMIDIAccessor.h" |
| 6 | 6 |
| 7 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 7 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 8 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 8 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 9 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 9 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 10 #include "content/shell/renderer/test_runner/test_runner.h" | 10 #include "content/shell/renderer/test_runner/test_runner.h" |
| 11 #include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h" | 11 #include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h" |
| 12 | 12 |
| 13 using namespace blink; | 13 using namespace blink; |
| 14 using WebTestRunner::TestInterfaces; | |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 class DidStartSessionTask : public WebTestRunner::WebMethodTask<MockWebMIDIAcces
sor> { | 19 class DidStartSessionTask : public WebMethodTask<MockWebMIDIAccessor> { |
| 21 public: | 20 public: |
| 22 DidStartSessionTask(MockWebMIDIAccessor* object, blink::WebMIDIAccessorClien
t* client, bool result) | 21 DidStartSessionTask(MockWebMIDIAccessor* object, blink::WebMIDIAccessorClien
t* client, bool result) |
| 23 : WebMethodTask<MockWebMIDIAccessor>(object) | 22 : WebMethodTask<MockWebMIDIAccessor>(object) |
| 24 , m_client(client) | 23 , m_client(client) |
| 25 , m_result(result) | 24 , m_result(result) |
| 26 { | 25 { |
| 27 } | 26 } |
| 28 | 27 |
| 29 virtual void runIfValid() OVERRIDE | 28 virtual void runIfValid() OVERRIDE |
| 30 { | 29 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 50 | 49 |
| 51 void MockWebMIDIAccessor::startSession() | 50 void MockWebMIDIAccessor::startSession() |
| 52 { | 51 { |
| 53 // Add a mock input and output port. | 52 // Add a mock input and output port. |
| 54 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInput
Name", "MockInputVersion"); | 53 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInput
Name", "MockInputVersion"); |
| 55 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOu
tputName", "MockOutputVersion"); | 54 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOu
tputName", "MockOutputVersion"); |
| 56 m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m
_interfaces->testRunner()->midiAccessorResult())); | 55 m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m
_interfaces->testRunner()->midiAccessorResult())); |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace content | 58 } // namespace content |
| OLD | NEW |