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 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef MockWebMIDIAccessor_h | 31 #ifndef MockWebMIDIAccessor_h |
32 #define MockWebMIDIAccessor_h | 32 #define MockWebMIDIAccessor_h |
33 | 33 |
34 #include "TestCommon.h" | 34 #include "TestCommon.h" |
35 #include "public/platform/WebMIDIAccessor.h" | 35 #include "public/platform/WebMIDIAccessor.h" |
| 36 #include "public/platform/WebNonCopyable.h" |
36 #include "public/testing/WebTask.h" | 37 #include "public/testing/WebTask.h" |
37 | 38 |
38 namespace WebKit { | 39 namespace WebKit { |
39 class WebMIDIAccessorClient; | 40 class WebMIDIAccessorClient; |
40 } | 41 } |
41 | 42 |
42 namespace WebTestRunner { | 43 namespace WebTestRunner { |
43 | 44 |
44 class TestInterfaces; | 45 class TestInterfaces; |
45 | 46 |
46 class MockWebMIDIAccessor : public WebKit::WebMIDIAccessor { | 47 class MockWebMIDIAccessor : public WebKit::WebMIDIAccessor, public WebKit::WebNo
nCopyable { |
47 public: | 48 public: |
48 explicit MockWebMIDIAccessor(WebKit::WebMIDIAccessorClient*, TestInterfaces*
); | 49 explicit MockWebMIDIAccessor(WebKit::WebMIDIAccessorClient*, TestInterfaces*
); |
49 virtual ~MockWebMIDIAccessor(); | 50 virtual ~MockWebMIDIAccessor(); |
50 | 51 |
51 // WebKit::WebMIDIAccessor implementation. | 52 // WebKit::WebMIDIAccessor implementation. |
52 virtual void startSession() OVERRIDE; | 53 virtual void startSession() OVERRIDE; |
53 virtual void sendMIDIData( | 54 virtual void sendMIDIData( |
54 unsigned portIndex, | 55 unsigned portIndex, |
55 const unsigned char* data, | 56 const unsigned char* data, |
56 size_t length, | 57 size_t length, |
57 double timestamp) OVERRIDE { } | 58 double timestamp) OVERRIDE { } |
58 | 59 |
59 // WebTask related methods | 60 // WebTask related methods |
60 WebTaskList* taskList() { return &m_taskList; } | 61 WebTaskList* taskList() { return &m_taskList; } |
61 | 62 |
62 private: | 63 private: |
63 WebKit::WebMIDIAccessorClient* m_client; | 64 WebKit::WebMIDIAccessorClient* m_client; |
64 WebTaskList m_taskList; | 65 WebTaskList m_taskList; |
65 TestInterfaces* m_interfaces; | 66 TestInterfaces* m_interfaces; |
66 }; | 67 }; |
67 | 68 |
68 } // namespace WebTestRunner | 69 } // namespace WebTestRunner |
69 | 70 |
70 #endif // MockWebMIDIAccessor_h | 71 #endif // MockWebMIDIAccessor_h |
OLD | NEW |