1 // Copyright 2010-2018, Google Inc. 2 // All rights reserved. 3 // 4 // Redistribution and use in source and binary forms, with or without 5 // modification, are permitted provided that the following conditions are 6 // met: 7 // 8 // * Redistributions of source code must retain the above copyright 9 // notice, this list of conditions and the following disclaimer. 10 // * Redistributions in binary form must reproduce the above 11 // copyright notice, this list of conditions and the following disclaimer 12 // in the documentation and/or other materials provided with the 13 // distribution. 14 // * Neither the name of Google Inc. nor the names of its 15 // contributors may be used to endorse or promote products derived from 16 // this software without specific prior written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 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. 29 30 #ifndef MOZC_RENDERER_UNIX_GTK_WRAPPER_MOCK_H_ 31 #define MOZC_RENDERER_UNIX_GTK_WRAPPER_MOCK_H_ 32 33 #include "renderer/unix/gtk_wrapper_interface.h" 34 #include "testing/base/public/gmock.h" 35 36 namespace mozc { 37 namespace renderer { 38 namespace gtk { 39 40 class GtkWrapperMock : public GtkWrapperInterface { 41 public: 42 MOCK_METHOD2(GSourceNew, GSource *(GSourceFuncs *source_funcs, 43 guint struct_size)); 44 MOCK_METHOD1(GtkWindowGetScreen, GdkScreen *(GtkWidget *window)); 45 MOCK_METHOD0(GtkDrawingAreaNew, GtkWidget *()); 46 MOCK_METHOD1(GtkWindowNew, GtkWidget *(GtkWindowType type)); 47 MOCK_METHOD3(GdkScreenGetMonitorAtPoint, gint(GdkScreen *screen, 48 gint x, 49 gint y)); 50 MOCK_METHOD3(GdkScreenGetMonitorGeometry, void(GdkScreen *screen, 51 gint monitor, 52 GdkRectangle *rectangle)); 53 MOCK_METHOD1(GObjectUnref, void(gpointer object)); 54 MOCK_METHOD4(GSignalConnect, void(gpointer instance, 55 const gchar *signal, 56 GCallback handler, 57 gpointer data)); 58 MOCK_METHOD2(GSourceAddPoll, void(GSource *source, GPollFD *fd)); 59 MOCK_METHOD2(GSourceAttach, void(GSource *source, GMainContext *context)); 60 MOCK_METHOD4(GSourceSetCallback, void(GSource *source, 61 GSourceFunc func, 62 gpointer data, 63 GDestroyNotify notify)); 64 MOCK_METHOD2(GSourceSetCanRecurse, void(GSource *source, 65 gboolean can_recurse)); 66 MOCK_METHOD0(GdkThreadsEnter, void()); 67 MOCK_METHOD0(GdkThreadsLeave, void()); 68 MOCK_METHOD2(GtkContainerAdd, void(GtkWidget *container, GtkWidget *widget)); 69 MOCK_METHOD0(GtkMain, void()); 70 MOCK_METHOD0(GtkMainQuit, void()); 71 MOCK_METHOD1(GtkWidgetHideAll, void(GtkWidget *widget)); 72 MOCK_METHOD5(GtkWidgetQueueDrawArea, void(GtkWidget *widget, 73 int x, 74 int y, 75 int width, 76 int height)); 77 MOCK_METHOD1(GtkWidgetShowAll, void(GtkWidget *widget)); 78 MOCK_METHOD3(GtkWindowGetPosition, void(GtkWidget *window, int *x, int *y)); 79 MOCK_METHOD3(GtkWindowGetSize, void(GtkWidget *window, int *width, 80 int *height)); 81 MOCK_METHOD1(GtkWindowIsActive, bool(GtkWidget *window)); 82 MOCK_METHOD3(GtkWindowMove, void(GtkWidget *window, int x, int y)); 83 MOCK_METHOD3(GtkWindowResize, void(GtkWidget *window, int width, int height)); 84 MOCK_METHOD2(GtkWidgetAddEvents, void(GtkWidget *widget, gint events)); 85 MOCK_METHOD1(GtkWidgetRealize, void(GtkWidget *widget)); 86 MOCK_METHOD2(GdkWindowSetTypeHint, void(GtkWidget *widget, 87 GdkWindowTypeHint hint)); 88 }; 89 90 } // namespace gtk 91 } // namespace renderer 92 } // namespace mozc 93 94 #endif // MOZC_RENDERER_UNIX_GTK_WRAPPER_MOCK_H_ 95