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 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 bool TestGraphics2D::Init() { | 35 bool TestGraphics2D::Init() { |
36 graphics_2d_interface_ = static_cast<const PPB_Graphics2D*>( | 36 graphics_2d_interface_ = static_cast<const PPB_Graphics2D*>( |
37 pp::Module::Get()->GetBrowserInterface(PPB_GRAPHICS_2D_INTERFACE)); | 37 pp::Module::Get()->GetBrowserInterface(PPB_GRAPHICS_2D_INTERFACE)); |
38 image_data_interface_ = static_cast<const PPB_ImageData*>( | 38 image_data_interface_ = static_cast<const PPB_ImageData*>( |
39 pp::Module::Get()->GetBrowserInterface(PPB_IMAGEDATA_INTERFACE)); | 39 pp::Module::Get()->GetBrowserInterface(PPB_IMAGEDATA_INTERFACE)); |
40 return graphics_2d_interface_ && image_data_interface_ && | 40 return graphics_2d_interface_ && image_data_interface_ && |
41 InitTestingInterface(); | 41 CheckTestingInterface(); |
42 } | 42 } |
43 | 43 |
44 void TestGraphics2D::RunTests(const std::string& filter) { | 44 void TestGraphics2D::RunTests(const std::string& filter) { |
45 RUN_TEST(InvalidResource, filter); | 45 RUN_TEST(InvalidResource, filter); |
46 RUN_TEST(InvalidSize, filter); | 46 RUN_TEST(InvalidSize, filter); |
47 RUN_TEST(Humongous, filter); | 47 RUN_TEST(Humongous, filter); |
48 RUN_TEST(InitToZero, filter); | 48 RUN_TEST(InitToZero, filter); |
49 RUN_TEST(Describe, filter); | 49 RUN_TEST(Describe, filter); |
50 RUN_TEST_FORCEASYNC_AND_NOT(Paint, filter); | 50 RUN_TEST_FORCEASYNC_AND_NOT(Paint, filter); |
51 RUN_TEST_FORCEASYNC_AND_NOT(Scroll, filter); | 51 RUN_TEST_FORCEASYNC_AND_NOT(Scroll, filter); |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 if (rv != PP_OK_COMPLETIONPENDING) | 621 if (rv != PP_OK_COMPLETIONPENDING) |
622 return "Second flush must fail asynchronously."; | 622 return "Second flush must fail asynchronously."; |
623 } else { | 623 } else { |
624 if (rv == PP_OK || rv == PP_OK_COMPLETIONPENDING) | 624 if (rv == PP_OK || rv == PP_OK_COMPLETIONPENDING) |
625 return "Second flush succeeded before callback ran."; | 625 return "Second flush succeeded before callback ran."; |
626 } | 626 } |
627 } | 627 } |
628 | 628 |
629 PASS(); | 629 PASS(); |
630 } | 630 } |
OLD | NEW |