| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_buffer.h" | 5 #include "ppapi/tests/test_buffer.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_buffer_dev.h" | 7 #include "ppapi/c/dev/ppb_buffer_dev.h" |
| 8 #include "ppapi/cpp/dev/buffer_dev.h" | 8 #include "ppapi/cpp/dev/buffer_dev.h" |
| 9 #include "ppapi/cpp/graphics_2d.h" | 9 #include "ppapi/cpp/graphics_2d.h" |
| 10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 std::string TestBuffer::TestInitToZero() { | 36 std::string TestBuffer::TestInitToZero() { |
| 37 pp::Buffer_Dev buffer(100); | 37 pp::Buffer_Dev buffer(100); |
| 38 if (buffer.is_null()) | 38 if (buffer.is_null()) |
| 39 return "Could not create buffer"; | 39 return "Could not create buffer"; |
| 40 | 40 |
| 41 if (buffer.size() != 100) | 41 if (buffer.size() != 100) |
| 42 return "Buffer size not as expected"; | 42 return "Buffer size not as expected"; |
| 43 | 43 |
| 44 // Now check that everything is 0. | 44 // Now check that everything is 0. |
| 45 unsigned char* bytes = static_cast<unsigned char *>(buffer.data()); | 45 unsigned char* bytes = static_cast<unsigned char *>(buffer.data()); |
| 46 for (int index = 0; index < buffer.size(); index++) { | 46 for (uint32_t index = 0; index < buffer.size(); index++) { |
| 47 if (bytes[index] != 0) | 47 if (bytes[index] != 0) |
| 48 return "Buffer isn't entirely zero"; | 48 return "Buffer isn't entirely zero"; |
| 49 } | 49 } |
| 50 | 50 |
| 51 return ""; | 51 return ""; |
| 52 } | 52 } |
| 53 | 53 |
| 54 std::string TestBuffer::TestIsBuffer() { | 54 std::string TestBuffer::TestIsBuffer() { |
| 55 // Test that a NULL resource isn't a buffer. | 55 // Test that a NULL resource isn't a buffer. |
| 56 pp::Resource null_resource; | 56 pp::Resource null_resource; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 68 // Make a valid buffer. | 68 // Make a valid buffer. |
| 69 pp::Buffer_Dev buffer(100); | 69 pp::Buffer_Dev buffer(100); |
| 70 if (buffer.is_null()) | 70 if (buffer.is_null()) |
| 71 return "Couldn't create buffer"; | 71 return "Couldn't create buffer"; |
| 72 if (!buffer_interface_->IsBuffer(buffer.pp_resource())) | 72 if (!buffer_interface_->IsBuffer(buffer.pp_resource())) |
| 73 return "Buffer should be identified as a buffer"; | 73 return "Buffer should be identified as a buffer"; |
| 74 | 74 |
| 75 return ""; | 75 return ""; |
| 76 } | 76 } |
| 77 | 77 |
| OLD | NEW |