| Index: ppapi/tests/test_graphics_2d.cc
|
| diff --git a/ppapi/tests/test_graphics_2d.cc b/ppapi/tests/test_graphics_2d.cc
|
| index 86de406bdf5ed91882a4a3cb2df16944cb52e5ae..cccb7ada1a118aebc8fbd0a3eecc5f0f5a806a3c 100644
|
| --- a/ppapi/tests/test_graphics_2d.cc
|
| +++ b/ppapi/tests/test_graphics_2d.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ppapi/cpp/image_data.h"
|
| #include "ppapi/cpp/instance.h"
|
| #include "ppapi/cpp/module.h"
|
| +#include "ppapi/cpp/private/graphics_2d_private.h"
|
| #include "ppapi/cpp/rect.h"
|
| #include "ppapi/tests/testing_instance.h"
|
|
|
| @@ -51,6 +52,7 @@ void TestGraphics2D::RunTests(const std::string& filter) {
|
| RUN_TEST_FORCEASYNC_AND_NOT(Scroll, filter);
|
| RUN_TEST_FORCEASYNC_AND_NOT(Replace, filter);
|
| RUN_TEST_FORCEASYNC_AND_NOT(Flush, filter);
|
| + RUN_TEST(Private, filter);
|
| }
|
|
|
| void TestGraphics2D::QuitMessageLoop() {
|
| @@ -628,3 +630,30 @@ std::string TestGraphics2D::TestFlush() {
|
|
|
| PASS();
|
| }
|
| +
|
| +std::string TestGraphics2D::TestPrivate() {
|
| + // Tests resource creation via the Graphics2DPrivate C++ wrapper
|
| + const int w=20, h=16;
|
| + const float scale=2.0f;
|
| + pp::Graphics2DPrivate dc(instance_, pp::Size(w, h), false, scale);
|
| + if (dc.is_null())
|
| + return "Failure creating a boring device";
|
| +
|
| + // Verify that the context has the specified number of pixels, desipte the
|
| + // non-identity scale
|
| + PP_Size size;
|
| + size.width = -1;
|
| + size.height = -1;
|
| + PP_Bool is_always_opaque = PP_FALSE;
|
| + if (!graphics_2d_interface_->Describe(dc.pp_resource(), &size,
|
| + &is_always_opaque))
|
| + return "Describe failed";
|
| + if (size.width != w || size.height != h ||
|
| + is_always_opaque != PP_FromBool(false))
|
| + return "Mismatch of data.";
|
| +
|
| + if (dc.get_scale() != scale)
|
| + return "Mismatch of get_scale";
|
| +
|
| + PASS();
|
| +}
|
|
|