~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Cemil Azizoglu, Ubuntu daily release
  • Date: 2014-08-11 19:52:06 UTC
  • mfrom: (1.1.71)
  • Revision ID: package-import@ubuntu.com-20140811195206-zoak8m13t0ii3699
Tags: 0.6.0+14.10.20140811-0ubuntu1
[ Cemil Azizoglu ]
* New upstream release 0.6.0 (https://launchpad.net/mir/+milestone/0.6.0)
  - mirclient ABI unchanged at 8. Clients do not need rebuilding.
  - mirserver ABI bumped to 24. Servers need rebuilding, but probably don't
    need modification:
    . Host lifecycle event listener for nested servers introduced.
    . Add query function to BasicSurface.
    . The (deprecated) function the_ipc_factory() is now removed.
    . Removed legacy support for overriding the focus controller or the
      frontend shell.
    . Added support for a common type for managing fd's.
    . Moved testdraw library to examples directory.
    . Added support for droping stale frames when a surface becomes exposed.
  - Enhancements:
    . Split underlying data transport out of MirSocketRpcChannel.
    . Introduced two new client-side functions : mir_surface_get_focus and
      mir_surface_get_visibility.
    . Added symbolic names for cursors.
    . Made "shared" code a true shared library.
    . Provide linker scripts to control symbols exported by [mesa|android]
      libmirclientplatform.
    . Correct xcursor loader test to fail properly instead of segfaulting.
    . Make mir::Fd type copy constructible.
    . Miscellaneous packaging related enhancements.
    . Miscellaneous build related enhancements.
    . Added automated test cases for detecting ABI breakage.
    . examples/fingerpaint: Enable frame dropping so it's faster and more
      responsive.
    . mirprotobuf folded into new libmircommon.
    . Don't propagate exceptions to graphics driver code.
    . Dropped unused/minimally used dependencies : boost-filesystem,
      boost-thread, boost-chrono, boost-regex.
    . platform: provide support for customizing Mir's behavior when a
      fatal_error occurs.
    . Expose an interface for touch visualization.
  - Bugs fixed:
    . Mir servers crash with SIGABRT - assertion failed at
      buffer_queue.cpp:136 - "!pending_client_notifications.empty()"
      (LP: #1335481)
    . [regression][hammerhead] Mir fails to start on Nexus 5 & 10 as it
      fails to turn vsync signal on (LP: #1345533)
    . [qtcomp] Random crash in Mir input when running AP tests: [terminate
      called after throwing an instance of '...' what(): assign: File exists]
      when constructing a mir::AsioMainLoop::FDHandler (LP: #1346952)
    . CI builds fail when trying to install libmircommon-dev (LP: #1348518)
    . [regression] Mir 0.6 GL clients crash immediately on startup (Mesa is
      trying to use X11 instead of Mir) (LP: #1350163)
    . qmlscene crashed with SIGSEGV in _M_release() on quit (LP: #1342694)
    . Clients cannot create surfaces when the screen is off (LP: #1344024)
    . The packaging of headers and libraries is confused (LP: #1347522)
    . [regression] Intermittent CI failure in
      ClientLibrary.receives_surface_dpi_value (LP: #1348095)
    . Installing mir-demos also unexpectedly installs *-dev packages
      (LP: #1297100)
    . mir_unit_tests: XCursorLoader.loads_cursors_from_testing_theme crashes
      on N4 (LP: #1342029)
    . [performance] Mir is spending at least 8% of its time in
       __android_log_print() (LP: #1343074)
    . [performance] Mir demo shell spends ~12% of its time in vector
      allocation under DemoRenderer::tessellate_*() (LP: #1349698)
    . mir_client_library_debug.h functions do not have C linkage
      (LP: #1349742)
    . mir client API is missing getters for some surface attributes
      (LP: #1336553)
    . Building Mir outputs lots of warnings about Android logging functions
      in 3rd_party/ (LP: #1348467)
    . The "shared" code should be a shared library (LP: #1341502)
    . Finish the removal of mirprotobuf library (LP: #1351133)
    . Release overlay buffers when screen is turned off (LP: #1350961)
    . mir_demo_server_shell --disable-overlays false renders incorrectly
      on android (partial fix for LP: #1348330)
    . Remember to honor MIR_ENABLE_TESTS and not emit tests if it's disabled
      (LP: #1352800)
    . Make it easier to separate command line options used by Mir from those
      used elsewhere (LP: #1351255)
    . Expose create_native_platform in libmirplatformgraphics.so
      (LP: #1353658)
    . Add versioning and pkg config to libmirplatform (LP: #1293944)
    . unity-system-compositor FTBFS against Mir: undefined reference to
      `...@MIR_CLIENT_8' (LP: #1355021)

[ Ubuntu daily release ]
* New rebuild forced

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
    EXPECT_EQ(mir_surface_state_fullscreen, surf.state());
187
187
}
188
188
 
189
 
TEST_F(Surface, dpi_is_initialized)
190
 
{
191
 
    using namespace testing;
192
 
 
193
 
    ms::BasicSurface surf(
194
 
        std::string("stub"),
195
 
        geom::Rectangle{{},{}},
196
 
        false,
197
 
        buffer_stream,
198
 
        std::shared_ptr<mi::InputChannel>(),
199
 
        stub_input_sender,
200
 
        null_configurator,
201
 
        std::shared_ptr<mg::CursorImage>(),
202
 
        report);
203
 
 
204
 
    EXPECT_EQ(0, surf.dpi()); // The current default. It will change.
205
 
}
206
 
 
207
 
TEST_F(Surface, dpi_changes)
208
 
{
209
 
    using namespace testing;
210
 
 
211
 
    ms::BasicSurface surf(
212
 
        std::string("stub"),
213
 
        geom::Rectangle{{},{}},
214
 
        false,
215
 
        buffer_stream,
216
 
        std::shared_ptr<mi::InputChannel>(),
217
 
        stub_input_sender,
218
 
        null_configurator,
219
 
        std::shared_ptr<mg::CursorImage>(),
220
 
        report);
221
 
 
222
 
    EXPECT_EQ(123, surf.configure(mir_surface_attrib_dpi, 123));
223
 
    EXPECT_EQ(123, surf.dpi());
224
 
 
225
 
    EXPECT_EQ(456, surf.configure(mir_surface_attrib_dpi, 456));
226
 
    EXPECT_EQ(456, surf.dpi());
227
 
 
228
 
    surf.configure(mir_surface_attrib_dpi, -1);
229
 
    EXPECT_EQ(456, surf.dpi());
230
 
 
231
 
    EXPECT_EQ(789, surf.configure(mir_surface_attrib_dpi, 789));
232
 
    EXPECT_EQ(789, surf.dpi());
233
 
}
234
 
 
235
189
bool operator==(MirEvent const& a, MirEvent const& b)
236
190
{
237
191
    // We will always fill unused bytes with zero, so memcmp is accurate...