am 7c1a487b
: fix build. update test to new API
* commit '7c1a487ba8c0a3b591a77e2ddcb33ef9bdfaff64': fix build. update test to new API
This commit is contained in:
commit
890b345f06
@ -23,11 +23,17 @@
|
||||
#include <utils/String8.h>
|
||||
|
||||
#include <private/gui/ComposerService.h>
|
||||
#include <binder/ProcessState.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
class SurfaceTest : public ::testing::Test {
|
||||
protected:
|
||||
|
||||
SurfaceTest() {
|
||||
ProcessState::self()->startThreadPool();
|
||||
}
|
||||
|
||||
virtual void SetUp() {
|
||||
mComposerClient = new SurfaceComposerClient;
|
||||
ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
|
||||
@ -81,14 +87,11 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
|
||||
sp<ANativeWindow> anw(mSurface);
|
||||
|
||||
// Verify the screenshot works with no protected buffers.
|
||||
sp<IMemoryHeap> heap;
|
||||
uint32_t w=0, h=0;
|
||||
PixelFormat fmt=0;
|
||||
sp<CpuConsumer> consumer = new CpuConsumer(1);
|
||||
sp<ISurfaceComposer> sf(ComposerService::getComposerService());
|
||||
sp<IBinder> display(sf->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
|
||||
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, &heap, &w, &h, &fmt, 64, 64, 0,
|
||||
0x7fffffff));
|
||||
ASSERT_TRUE(heap != NULL);
|
||||
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, consumer->getBufferQueue(),
|
||||
64, 64, 0, 0x7fffffff, true));
|
||||
|
||||
// Set the PROTECTED usage bit and verify that the screenshot fails. Note
|
||||
// that we need to dequeue a buffer in order for it to actually get
|
||||
@ -116,11 +119,8 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
|
||||
&buf));
|
||||
ASSERT_EQ(NO_ERROR, anw->queueBuffer(anw.get(), buf, -1));
|
||||
}
|
||||
heap = 0;
|
||||
w = h = fmt = 0;
|
||||
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, &heap, &w, &h, &fmt,
|
||||
64, 64, 0, 0x7fffffff));
|
||||
ASSERT_TRUE(heap != NULL);
|
||||
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, consumer->getBufferQueue(),
|
||||
64, 64, 0, 0x7fffffff, true));
|
||||
}
|
||||
|
||||
TEST_F(SurfaceTest, ConcreteTypeIsSurface) {
|
||||
|
Loading…
Reference in New Issue
Block a user