~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to tests/unit-tests/scene/test_surface_data.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt, Ubuntu daily release
  • Date: 2014-01-08 02:04:38 UTC
  • mfrom: (1.1.54)
  • Revision ID: package-import@ubuntu.com-20140108020438-ikbu7qqm9v2l026y
Tags: 0.1.3+14.04.20140108-0ubuntu1
[ Daniel van Vugt ]
* Preparing for release 0.1.3

[ Ubuntu daily release ]
* Automatic snapshot from revision 1170

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "mir/geometry/rectangle.h"
22
22
 
23
 
#include "mir_test_doubles/mock_surface_state.h"
24
23
#include "mir_test/fake_shared.h"
25
24
 
26
25
#include <algorithm>
28
27
#include <gmock/gmock.h>
29
28
 
30
29
namespace mc = mir::compositor;
31
 
namespace mtd = mir::test::doubles;
32
30
namespace mt = mir::test;
33
31
namespace mi = mir::input;
34
32
namespace ms = mir::scene;
58
56
    geom::Size size;
59
57
    geom::Rectangle rect;
60
58
 
61
 
    MockCallback mock_callback;
 
59
    testing::NiceMock<MockCallback> mock_callback;
62
60
    std::function<void()> null_change_cb;
63
61
    std::function<void()> mock_change_cb;
64
62
};
66
64
}
67
65
 
68
66
TEST_F(SurfaceDataTest, basics)
69
 
 
67
{
70
68
    ms::SurfaceData data{name, rect, null_change_cb, false};
71
69
    EXPECT_EQ(name, data.name());
72
70
    EXPECT_EQ(rect.size, data.size());
75
73
}
76
74
 
77
75
TEST_F(SurfaceDataTest, update_position)
78
 
 
76
{
79
77
    EXPECT_CALL(mock_callback, call())
80
78
        .Times(1);
81
79
 
88
86
}
89
87
 
90
88
TEST_F(SurfaceDataTest, update_size)
91
 
 
89
{
92
90
    geom::Size const new_size{34, 56};
93
91
 
94
92
    EXPECT_CALL(mock_callback, call())