~mir-team/mir/development-branch

« back to all changes in this revision

Viewing changes to tests/unit-tests/client/android/test_android_native_window.cpp

  • Committer: Daniel van Vugt
  • Author(s): Kevin DuBois
  • Date: 2013-11-13 02:55:46 UTC
  • mfrom: (1062.1.23 mali-client-render-support)
  • Revision ID: daniel.van.vugt@canonical.com-20131113025546-2u059ffogt5yj2yz
android: support driver hooks for the Mali T604 (present in nexus 10)

The exynos driver needed some function hooks implemented. This change
implements those hooks and gets the TestClientIPCRender test to pass. This
test sends buffers over IPC to a client, and the client then establishes an
egl context, renders to the buffer, and checks the buffer content back on the
server side.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
    auto ret = window->dequeueBuffer(window.get(), &tmp, &fencefd);
289
289
    EXPECT_EQ(0, ret);
290
290
}
 
291
 
 
292
TEST_F(AndroidNativeWindowTest, native_window_cancel_hook_behavior)
 
293
{
 
294
    using namespace testing;
 
295
    ANativeWindowBuffer buffer;
 
296
    int fence_fd = 33;
 
297
 
 
298
    EXPECT_CALL(*mock_driver_interpreter, driver_returns_buffer(&buffer, _))
 
299
        .Times(1);
 
300
 
 
301
    std::shared_ptr<ANativeWindow> window = std::make_shared<mga::MirNativeWindow>(mock_driver_interpreter);
 
302
    auto rc = window->cancelBuffer(window.get(), &buffer, fence_fd);
 
303
    EXPECT_EQ(0, rc);
 
304
}