~ubuntu-branches/ubuntu/wily/mir/wily-proposed

« back to all changes in this revision

Viewing changes to tests/unit-tests/graphics/android/test_hwc10_device.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-01-08 02:04:38 UTC
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20140108020438-e1npu0pm7qdv5wc4
Tags: upstream-0.1.3+14.04.20140108
ImportĀ upstreamĀ versionĀ 0.1.3+14.04.20140108

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17
17
 */
18
18
 
19
 
#include "src/server/graphics/android/hwc10_device.h"
 
19
#include "src/platform/graphics/android/hwc10_device.h"
20
20
#include "mir_test_doubles/mock_display_device.h"
21
21
#include "mir_test_doubles/mock_hwc_composer_device_1.h"
22
22
#include "mir_test_doubles/mock_buffer.h"
40
40
        int width = 88;
41
41
        int height = 4;
42
42
        test_size = geom::Size{width, height};
43
 
        test_pf = geom::PixelFormat::abgr_8888;
 
43
        test_pf = mir_pixel_format_abgr_8888;
44
44
        int fbnum = 558;
45
45
        mock_hwc_device = std::make_shared<testing::NiceMock<mtd::MockHWCComposerDevice1>>();
46
46
        mock_fb_device = std::make_shared<mtd::MockFBHalDevice>(
47
 
            width, height, HAL_PIXEL_FORMAT_RGBA_8888, fbnum); 
 
47
            width, height, HAL_PIXEL_FORMAT_RGBA_8888, fbnum);
48
48
        mock_vsync = std::make_shared<testing::NiceMock<mtd::MockVsyncCoordinator>>();
49
49
        mock_buffer = std::make_shared<NiceMock<mtd::MockBuffer>>();
50
50
    }
51
51
 
52
 
    geom::PixelFormat test_pf;
 
52
    MirPixelFormat test_pf;
53
53
    geom::Size test_size;
54
54
    std::shared_ptr<mtd::MockHWCComposerDevice1> mock_hwc_device;
55
55
    std::shared_ptr<mtd::MockFBHalDevice> mock_fb_device;
61
61
{
62
62
    using namespace testing;
63
63
 
64
 
    EGLDisplay dpy;
65
 
    EGLSurface sur;
 
64
    int fake_dpy = 0;
 
65
    int fake_sur = 0;
 
66
    EGLDisplay dpy = &fake_dpy;
 
67
    EGLSurface sur = &fake_sur;
66
68
 
67
69
    EXPECT_CALL(*mock_hwc_device, set_interface(mock_hwc_device.get(), 1, _))
68
70
        .Times(1);
71
73
 
72
74
    device.gpu_render(dpy, sur);
73
75
 
74
 
    Mock::VerifyAndClearExpectations(mock_hwc_device.get());
75
 
 
76
76
    EXPECT_EQ(dpy, mock_hwc_device->display0_set_content.dpy);
77
77
    EXPECT_EQ(sur, mock_hwc_device->display0_set_content.sur);
78
78
    EXPECT_EQ(-1, mock_hwc_device->display0_set_content.retireFenceFd);
102
102
{
103
103
    using namespace testing;
104
104
 
105
 
    EGLDisplay dpy = reinterpret_cast<EGLDisplay>(0x1234);
106
 
    EGLSurface sur = reinterpret_cast<EGLSurface>(0x4455);
 
105
    int fake_dpy = 0;
 
106
    int fake_sur = 0;
 
107
    EGLDisplay dpy = &fake_dpy;
 
108
    EGLSurface sur = &fake_sur;
107
109
    EXPECT_CALL(*mock_hwc_device, set_interface(mock_hwc_device.get(), _, _))
108
110
        .Times(1)
109
111
        .WillOnce(Return(-1));