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

Unified Diff: components/mus/public/cpp/surfaces/tests/surface_unittest.cc

Issue 2064833002: Implement DrawQuad StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix move constructor Created 4 years, 6 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/mus/public/cpp/surfaces/surfaces_type_converters.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/surfaces/tests/surface_unittest.cc
diff --git a/components/mus/public/cpp/surfaces/tests/surface_unittest.cc b/components/mus/public/cpp/surfaces/tests/surface_unittest.cc
index e93126fed8970c830a8badf130dd590fcbaaa573..cdf539f359f05d9f95aa838078b870f6ecec9e77 100644
--- a/components/mus/public/cpp/surfaces/tests/surface_unittest.cc
+++ b/components/mus/public/cpp/surfaces/tests/surface_unittest.cc
@@ -21,8 +21,6 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkXfermode.h"
-using cc::mojom::Color;
-using cc::mojom::ColorPtr;
using cc::mojom::DebugBorderQuadState;
using cc::mojom::DebugBorderQuadStatePtr;
using cc::mojom::DrawQuad;
@@ -49,12 +47,6 @@ namespace mojo {
namespace {
-TEST(SurfaceLibTest, Color) {
- SkColor arbitrary_color = SK_ColorMAGENTA;
- SkColor round_trip = Color::From(arbitrary_color).To<SkColor>();
- EXPECT_EQ(arbitrary_color, round_trip);
-}
-
class SurfaceLibQuadTest : public testing::Test {
public:
SurfaceLibQuadTest()
@@ -97,7 +89,7 @@ TEST_F(SurfaceLibQuadTest, ColorQuad) {
EXPECT_EQ(needs_blending, mus_quad->needs_blending);
ASSERT_TRUE(mus_quad->solid_color_quad_state);
SolidColorQuadStatePtr& mus_color_state = mus_quad->solid_color_quad_state;
- EXPECT_TRUE(Color::From(arbitrary_color).Equals(mus_color_state->color));
+ EXPECT_EQ(arbitrary_color, mus_color_state->color);
EXPECT_EQ(force_anti_aliasing_off, mus_color_state->force_anti_aliasing_off);
}
@@ -143,8 +135,7 @@ TEST_F(SurfaceLibQuadTest, TextureQuad) {
EXPECT_EQ(premultiplied_alpha, mus_texture_state->premultiplied_alpha);
EXPECT_EQ(uv_top_left, mus_texture_state->uv_top_left);
EXPECT_EQ(uv_bottom_right, mus_texture_state->uv_bottom_right);
- EXPECT_TRUE(Color::From(background_color)
- .Equals(mus_texture_state->background_color));
+ EXPECT_EQ(background_color, mus_texture_state->background_color);
for (size_t i = 0; i < 4; ++i) {
EXPECT_EQ(vertex_opacity[i], mus_texture_state->vertex_opacity[i]) << i;
}
@@ -156,7 +147,6 @@ TEST_F(SurfaceLibQuadTest, TextureQuadEmptyVertexOpacity) {
DrawQuadPtr mus_texture_quad = DrawQuad::New();
mus_texture_quad->material = cc::mojom::Material::TEXTURE_CONTENT;
TextureQuadStatePtr mus_texture_state = TextureQuadState::New();
- mus_texture_state->background_color = Color::New();
mus_texture_quad->texture_quad_state = std::move(mus_texture_state);
RenderPassPtr mus_pass = RenderPass::New();
mus_pass->id.layer_id = 1;
@@ -170,23 +160,6 @@ TEST_F(SurfaceLibQuadTest, TextureQuadEmptyVertexOpacity) {
EXPECT_FALSE(pass);
}
-TEST_F(SurfaceLibQuadTest, TextureQuadEmptyBackgroundColor) {
- DrawQuadPtr mus_texture_quad = DrawQuad::New();
- mus_texture_quad->material = cc::mojom::Material::TEXTURE_CONTENT;
- TextureQuadStatePtr mus_texture_state = TextureQuadState::New();
- mus_texture_state->vertex_opacity = mojo::Array<float>::New(4);
- mus_texture_quad->texture_quad_state = std::move(mus_texture_state);
- RenderPassPtr mus_pass = RenderPass::New();
- mus_pass->id.layer_id = 1;
- mus_pass->id.index = 1u;
- mus_pass->quads.push_back(std::move(mus_texture_quad));
- mus_pass->shared_quad_states.push_back(cc::SharedQuadState());
-
- std::unique_ptr<cc::RenderPass> pass =
- mus_pass.To<std::unique_ptr<cc::RenderPass>>();
- EXPECT_FALSE(pass);
-}
-
TEST(SurfaceLibTest, RenderPass) {
std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create();
cc::RenderPassId pass_id(1, 6);
@@ -351,8 +324,7 @@ TEST_F(SurfaceLibQuadTest, DebugBorderQuad) {
ASSERT_TRUE(mus_quad->debug_border_quad_state);
DebugBorderQuadStatePtr& mus_debug_border_state =
mus_quad->debug_border_quad_state;
- EXPECT_TRUE(
- Color::From(arbitrary_color).Equals(mus_debug_border_state->color));
+ EXPECT_EQ(arbitrary_color, mus_debug_border_state->color);
EXPECT_EQ(width, mus_debug_border_state->width);
}
« no previous file with comments | « components/mus/public/cpp/surfaces/surfaces_type_converters.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698