ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / native_client_sdk / src / tests / nacl_io_test / pepper_interface_mock.cc
blob06841116c9210e737138298eb7db127c1648c0b4
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "pepper_interface_mock.h"
7 PepperInterfaceMock::PepperInterfaceMock(PP_Instance instance)
8 : instance_(instance) {
9 // Initialize interfaces.
10 #include "nacl_io/pepper/undef_macros.h"
11 #include "nacl_io/pepper/define_empty_macros.h"
12 #undef BEGIN_INTERFACE
13 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
14 BaseClass##interface_ = new BaseClass##Mock;
15 #include "nacl_io/pepper/all_interfaces.h"
18 PepperInterfaceMock::~PepperInterfaceMock() {
19 // Delete interfaces.
20 #include "nacl_io/pepper/undef_macros.h"
21 #include "nacl_io/pepper/define_empty_macros.h"
22 #undef BEGIN_INTERFACE
23 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
24 delete BaseClass##interface_;
25 #include "nacl_io/pepper/all_interfaces.h"
29 PP_Instance PepperInterfaceMock::GetInstance() {
30 return instance_;
33 // Define Getter functions, constructors, destructors.
34 #include "nacl_io/pepper/undef_macros.h"
35 #include "nacl_io/pepper/define_empty_macros.h"
36 #undef BEGIN_INTERFACE
37 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
38 BaseClass##Mock* PepperInterfaceMock::Get##BaseClass() { \
39 return BaseClass##interface_; \
40 } \
41 BaseClass##Mock::BaseClass##Mock() { \
42 } \
43 BaseClass##Mock::~BaseClass##Mock() { \
45 #include "nacl_io/pepper/all_interfaces.h"