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

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

Issue 8536031: Reland http://codereview.chromium.org/8477015 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge AGAIN Created 9 years, 1 month 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/tests/test_graphics_2d.h ('k') | ppapi/tests/test_graphics_3d.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) 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 23 matching lines...) Expand all
34 34
35 bool TestGraphics2D::Init() { 35 bool TestGraphics2D::Init() {
36 graphics_2d_interface_ = reinterpret_cast<PPB_Graphics2D const*>( 36 graphics_2d_interface_ = reinterpret_cast<PPB_Graphics2D const*>(
37 pp::Module::Get()->GetBrowserInterface(PPB_GRAPHICS_2D_INTERFACE)); 37 pp::Module::Get()->GetBrowserInterface(PPB_GRAPHICS_2D_INTERFACE));
38 image_data_interface_ = reinterpret_cast<PPB_ImageData const*>( 38 image_data_interface_ = reinterpret_cast<PPB_ImageData const*>(
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 InitTestingInterface();
42 } 42 }
43 43
44 void TestGraphics2D::RunTest() { 44 void TestGraphics2D::RunTests(const std::string& filter) {
45 RUN_TEST(InvalidResource); 45 RUN_TEST(InvalidResource, filter);
46 RUN_TEST(InvalidSize); 46 RUN_TEST(InvalidSize, filter);
47 RUN_TEST(Humongous); 47 RUN_TEST(Humongous, filter);
48 RUN_TEST(InitToZero); 48 RUN_TEST(InitToZero, filter);
49 RUN_TEST(Describe); 49 RUN_TEST(Describe, filter);
50 RUN_TEST_FORCEASYNC_AND_NOT(Paint); 50 RUN_TEST_FORCEASYNC_AND_NOT(Paint, filter);
51 RUN_TEST_FORCEASYNC_AND_NOT(Scroll); 51 RUN_TEST_FORCEASYNC_AND_NOT(Scroll, filter);
52 RUN_TEST_FORCEASYNC_AND_NOT(Replace); 52 RUN_TEST_FORCEASYNC_AND_NOT(Replace, filter);
53 RUN_TEST_FORCEASYNC_AND_NOT(Flush); 53 RUN_TEST_FORCEASYNC_AND_NOT(Flush, filter);
54 } 54 }
55 55
56 void TestGraphics2D::QuitMessageLoop() { 56 void TestGraphics2D::QuitMessageLoop() {
57 testing_interface_->QuitMessageLoop(instance_->pp_instance()); 57 testing_interface_->QuitMessageLoop(instance_->pp_instance());
58 } 58 }
59 59
60 bool TestGraphics2D::ReadImageData(const pp::Graphics2D& dc, 60 bool TestGraphics2D::ReadImageData(const pp::Graphics2D& dc,
61 pp::ImageData* image, 61 pp::ImageData* image,
62 const pp::Point& top_left) const { 62 const pp::Point& top_left) const {
63 return PP_ToBool(testing_interface_->ReadImageData( 63 return PP_ToBool(testing_interface_->ReadImageData(
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_graphics_2d.h ('k') | ppapi/tests/test_graphics_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698