Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: components/exo/surface_unittest.cc

Issue 1802993003: exo: Add support for secure_output interface to wayland bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-protocols-secure-contents
Patch Set: improve unit test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/surface.cc ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface_unittest.cc
diff --git a/components/exo/surface_unittest.cc b/components/exo/surface_unittest.cc
index 28b7cd2aad48f9b23376f7742993483be4f2aa5c..935596ff3a64433203fb9ff15f8c00716d3e2cd8 100644
--- a/components/exo/surface_unittest.cc
+++ b/components/exo/surface_unittest.cc
@@ -133,6 +133,26 @@ TEST_F(SurfaceTest, SetViewport) {
EXPECT_EQ(viewport.ToString(), surface->bounds().size().ToString());
}
+TEST_F(SurfaceTest, SetOnlyVisibleOnSecureOutput) {
+ gfx::Size buffer_size(1, 1);
+ scoped_ptr<Buffer> buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
+ scoped_ptr<Surface> surface(new Surface);
+
+ surface->Attach(buffer.get());
+ surface->SetOnlyVisibleOnSecureOutput(true);
+ surface->Commit();
+
+ cc::TextureMailbox mailbox;
+ scoped_ptr<cc::SingleReleaseCallback> release_callback;
+ bool rv = surface->layer()->PrepareTextureMailbox(&mailbox, &release_callback,
+ false);
+ ASSERT_TRUE(rv);
+
+ EXPECT_TRUE(mailbox.secure_output_only());
+ release_callback->Run(gpu::SyncToken(), false);
+}
+
TEST_F(SurfaceTest, Commit) {
scoped_ptr<Surface> surface(new Surface);
« no previous file with comments | « components/exo/surface.cc ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698