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_graphics_2d.h" | 5 #include "ppapi/tests/test_graphics_2d.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "ppapi/c/dev/ppb_testing_dev.h" | 10 #include "ppapi/c/dev/ppb_testing_dev.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 pp::Graphics2D b(instance_, pp::Size(0, 16), false); | 237 pp::Graphics2D b(instance_, pp::Size(0, 16), false); |
238 if (!b.is_null()) | 238 if (!b.is_null()) |
239 return "0 width accepted"; | 239 return "0 width accepted"; |
240 | 240 |
241 // Need to use the C API since pp::Size prevents negative sizes. | 241 // Need to use the C API since pp::Size prevents negative sizes. |
242 PP_Size size; | 242 PP_Size size; |
243 size.width = 16; | 243 size.width = 16; |
244 size.height = -16; | 244 size.height = -16; |
245 ASSERT_FALSE(!!graphics_2d_interface_->Create( | 245 ASSERT_FALSE(!!graphics_2d_interface_->Create( |
246 pp::Module::Get()->pp_module(), &size, PP_FALSE)); | 246 instance_->pp_instance(), &size, PP_FALSE)); |
247 | 247 |
248 size.width = -16; | 248 size.width = -16; |
249 size.height = 16; | 249 size.height = 16; |
250 ASSERT_FALSE(!!graphics_2d_interface_->Create( | 250 ASSERT_FALSE(!!graphics_2d_interface_->Create( |
251 pp::Module::Get()->pp_module(), &size, PP_FALSE)); | 251 instance_->pp_instance(), &size, PP_FALSE)); |
252 | 252 |
253 PASS(); | 253 PASS(); |
254 } | 254 } |
255 | 255 |
256 std::string TestGraphics2D::TestHumongous() { | 256 std::string TestGraphics2D::TestHumongous() { |
257 pp::Graphics2D a(instance_, pp::Size(100000, 100000), false); | 257 pp::Graphics2D a(instance_, pp::Size(100000, 100000), false); |
258 if (!a.is_null()) | 258 if (!a.is_null()) |
259 return "Humongous device created"; | 259 return "Humongous device created"; |
260 PASS(); | 260 PASS(); |
261 } | 261 } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 if (rv != PP_OK) { | 534 if (rv != PP_OK) { |
535 // If the first flush would block, then a second should fail. | 535 // If the first flush would block, then a second should fail. |
536 rv = dc_nopaints.Flush(pp::CompletionCallback(&FlushCallbackNOP, NULL)); | 536 rv = dc_nopaints.Flush(pp::CompletionCallback(&FlushCallbackNOP, NULL)); |
537 if (rv == PP_OK || rv == PP_OK_COMPLETIONPENDING) | 537 if (rv == PP_OK || rv == PP_OK_COMPLETIONPENDING) |
538 return "Second flush succeeded before callback ran."; | 538 return "Second flush succeeded before callback ran."; |
539 } | 539 } |
540 | 540 |
541 PASS(); | 541 PASS(); |
542 } | 542 } |
OLD | NEW |