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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 MockWebMIDIAccessor::MockWebMIDIAccessor(WebKit::WebMIDIAccessorClient* client) | 39 MockWebMIDIAccessor::MockWebMIDIAccessor(WebKit::WebMIDIAccessorClient* client) |
40 : m_client(client) | 40 : m_client(client) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 MockWebMIDIAccessor::~MockWebMIDIAccessor() | 44 MockWebMIDIAccessor::~MockWebMIDIAccessor() |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 void MockWebMIDIAccessor::requestAccess(bool requestSysex) | 48 void MockWebMIDIAccessor::startSession() |
49 { | 49 { |
50 // Allows us to test both the success and error case. | 50 // Add a mock input and output port. |
51 if (requestSysex) { | 51 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInput
Name", "MockInputVersion"); |
52 m_client->didBlockAccess(); | 52 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOu
tputName", "MockOutputVersion"); |
53 } else { | 53 m_client->didStartSession(); |
54 // Add a mock input and output port. | |
55 m_client->didAddInputPort("MockInputID", "MockInputManufacturer", "MockI
nputName", "MockInputVersion"); | |
56 m_client->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "Mo
ckOutputName", "MockOutputVersion"); | |
57 m_client->didAllowAccess(); | |
58 } | |
59 } | 54 } |
60 | 55 |
61 } // namespace WebTestRunner | 56 } // namespace WebTestRunner |
OLD | NEW |