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

Unified Diff: components/exo/surface_unittest.cc

Issue 2160113002: exo: Fullscreen overlay candidates support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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') | no next file » | 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 7e9481f45854797935231c90cef0457351e522c0..cb41e575fc3bf712337888f08fb365830ef4509c 100644
--- a/components/exo/surface_unittest.cc
+++ b/components/exo/surface_unittest.cc
@@ -5,6 +5,7 @@
#include "base/bind.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/delegated_frame_data.h"
+#include "cc/quads/texture_draw_quad.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
#include "components/exo/buffer.h"
@@ -214,6 +215,27 @@ TEST_F(SurfaceTest, SetBlendMode) {
->ShouldDrawWithBlending());
}
+TEST_F(SurfaceTest, OverlayCandidate) {
+ gfx::Size buffer_size(1, 1);
+ std::unique_ptr<Buffer> buffer(new Buffer(
+ exo_test_helper()->CreateGpuMemoryBuffer(buffer_size), 0, 0, true, true));
+ std::unique_ptr<Surface> surface(new Surface);
+
+ surface->Attach(buffer.get());
+ surface->Commit();
+
+ const cc::DelegatedFrameData* frame_data = GetFrameFromSurface(surface.get());
+ ASSERT_EQ(1u, frame_data->render_pass_list.size());
+ ASSERT_EQ(1u, frame_data->render_pass_list.back()->quad_list.size());
+ cc::DrawQuad* draw_quad =
+ frame_data->render_pass_list.back()->quad_list.back();
+ ASSERT_EQ(cc::DrawQuad::TEXTURE_CONTENT, draw_quad->material);
+
+ const cc::TextureDrawQuad* texture_quad =
+ cc::TextureDrawQuad::MaterialCast(draw_quad);
+ EXPECT_FALSE(texture_quad->resource_size_in_pixels().IsEmpty());
+}
+
TEST_F(SurfaceTest, SetAlpha) {
gfx::Size buffer_size(1, 1);
std::unique_ptr<Buffer> buffer(
« no previous file with comments | « components/exo/surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698