Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: Tools/DumpRenderTree/chromium/TestRunner/src/MockWebMIDIAccessor.cpp

Issue 18260005: Web MIDI: remove old platform API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@midi_permission_request
Patch Set: (rebase) Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Tools/DumpRenderTree/chromium/TestRunner/src/MockWebMIDIAccessor.h ('k') | public/platform/WebMIDIAccessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698