| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/tests/test_image_data.h" | 5 #include "ppapi/tests/test_image_data.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "ppapi/cpp/graphics_2d.h" | 9 #include "ppapi/cpp/graphics_2d.h" |
| 8 #include "ppapi/cpp/image_data.h" | 10 #include "ppapi/cpp/image_data.h" |
| 9 #include "ppapi/cpp/instance.h" | 11 #include "ppapi/cpp/instance.h" |
| 10 #include "ppapi/cpp/module.h" | 12 #include "ppapi/cpp/module.h" |
| 11 #include "ppapi/tests/testing_instance.h" | 13 #include "ppapi/tests/testing_instance.h" |
| 12 | 14 |
| 13 REGISTER_TEST_CASE(ImageData); | 15 REGISTER_TEST_CASE(ImageData); |
| 14 | 16 |
| 15 bool TestImageData::Init() { | 17 bool TestImageData::Init() { |
| 16 image_data_interface_ = static_cast<const PPB_ImageData*>( | 18 image_data_interface_ = static_cast<const PPB_ImageData*>( |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 pp::Graphics2D device(instance_, pp::Size(w, h), true); | 176 pp::Graphics2D device(instance_, pp::Size(w, h), true); |
| 175 if (device.is_null()) | 177 if (device.is_null()) |
| 176 return "Couldn't create device context"; | 178 return "Couldn't create device context"; |
| 177 if (image_data_interface_->IsImageData(device.pp_resource())) | 179 if (image_data_interface_->IsImageData(device.pp_resource())) |
| 178 return "Device context was reported as an image"; | 180 return "Device context was reported as an image"; |
| 179 | 181 |
| 180 ASSERT_SUBTEST_SUCCESS(SubTestIsImageData(PP_IMAGEDATAFORMAT_BGRA_PREMUL)); | 182 ASSERT_SUBTEST_SUCCESS(SubTestIsImageData(PP_IMAGEDATAFORMAT_BGRA_PREMUL)); |
| 181 ASSERT_SUBTEST_SUCCESS(SubTestIsImageData(PP_IMAGEDATAFORMAT_RGBA_PREMUL)); | 183 ASSERT_SUBTEST_SUCCESS(SubTestIsImageData(PP_IMAGEDATAFORMAT_RGBA_PREMUL)); |
| 182 PASS(); | 184 PASS(); |
| 183 } | 185 } |
| OLD | NEW |