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

Side by Side Diff: ppapi/tests/test_buffer.cc

Issue 5410001: Change trusted shared memory interface to match audio.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.cc ('k') | webkit/glue/plugins/pepper_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.cc ('k') | webkit/glue/plugins/pepper_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698