OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "MockWebMIDIAccessor.h" | 31 #include "MockWebMIDIAccessor.h" |
32 | 32 |
33 #include "TestInterfaces.h" | 33 #include "TestInterfaces.h" |
34 #include "TestRunner.h" | 34 #include "TestRunner.h" |
35 #include "public/platform/WebMIDIAccessorClient.h" | 35 #include "public/platform/WebMIDIAccessorClient.h" |
36 #include "public/testing/WebTestDelegate.h" | 36 #include "public/testing/WebTestDelegate.h" |
37 #include "public/testing/WebTestRunner.h" | 37 #include "public/testing/WebTestRunner.h" |
38 | 38 |
39 using namespace WebKit; | 39 using namespace blink; |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 class DidStartSessionTask : public WebTestRunner::WebMethodTask<WebTestRunner::M
ockWebMIDIAccessor> { | 43 class DidStartSessionTask : public WebTestRunner::WebMethodTask<WebTestRunner::M
ockWebMIDIAccessor> { |
44 public: | 44 public: |
45 DidStartSessionTask(WebTestRunner::MockWebMIDIAccessor* object, WebKit::WebM
IDIAccessorClient* client, bool result) | 45 DidStartSessionTask(WebTestRunner::MockWebMIDIAccessor* object, blink::WebMI
DIAccessorClient* client, bool result) |
46 : WebMethodTask<WebTestRunner::MockWebMIDIAccessor>(object) | 46 : WebMethodTask<WebTestRunner::MockWebMIDIAccessor>(object) |
47 , m_client(client) | 47 , m_client(client) |
48 , m_result(result) | 48 , m_result(result) |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 virtual void runIfValid() OVERRIDE | 52 virtual void runIfValid() OVERRIDE |
53 { | 53 { |
54 m_client->didStartSession(m_result); | 54 m_client->didStartSession(m_result); |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 WebKit::WebMIDIAccessorClient* m_client; | 58 blink::WebMIDIAccessorClient* m_client; |
59 bool m_result; | 59 bool m_result; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 namespace WebTestRunner { | 64 namespace WebTestRunner { |
65 | 65 |
66 MockWebMIDIAccessor::MockWebMIDIAccessor(WebKit::WebMIDIAccessorClient* client,
TestInterfaces* interfaces) | 66 MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, T
estInterfaces* interfaces) |
67 : m_client(client) | 67 : m_client(client) |
68 , m_interfaces(interfaces) | 68 , m_interfaces(interfaces) |
69 { | 69 { |
70 } | 70 } |
71 | 71 |
72 MockWebMIDIAccessor::~MockWebMIDIAccessor() | 72 MockWebMIDIAccessor::~MockWebMIDIAccessor() |
73 { | 73 { |
74 } | 74 } |
75 | 75 |
76 void MockWebMIDIAccessor::startSession() | 76 void MockWebMIDIAccessor::startSession() |
77 { | 77 { |
78 // Add a mock input and output port. | 78 // Add a mock input and output port. |
79 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInput
Name", "MockInputVersion"); | 79 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInput
Name", "MockInputVersion"); |
80 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOu
tputName", "MockOutputVersion"); | 80 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOu
tputName", "MockOutputVersion"); |
81 m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m
_interfaces->testRunner()->midiAccessorResult())); | 81 m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m
_interfaces->testRunner()->midiAccessorResult())); |
82 } | 82 } |
83 | 83 |
84 } // namespace WebTestRunner | 84 } // namespace WebTestRunner |
OLD | NEW |