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

Side by Side Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl_unittest.cc

Issue 11414171: Migrate Graphics2D to new design. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « webkit/plugins/ppapi/ppb_graphics_2d_impl.h ('k') | webkit/plugins/ppapi/ppb_image_data_impl.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gfx/point.h" 7 #include "ui/gfx/point.h"
8 #include "ui/gfx/rect.h" 8 #include "ui/gfx/rect.h"
9 #include "ui/gfx/safe_integer_conversions.h" 9 #include "ui/gfx/safe_integer_conversions.h"
10 #include "webkit/plugins/ppapi/ppapi_unittest.h" 10 #include "webkit/plugins/ppapi/ppapi_unittest.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 EXPECT_EQ(delta, gfx::Point(tests[i].dx2, tests[i].dy2)); 80 EXPECT_EQ(delta, gfx::Point(tests[i].dx2, tests[i].dy2));
81 } 81 }
82 // Reverse the scale and ensure all the original pixels are still inside 82 // Reverse the scale and ensure all the original pixels are still inside
83 // the result. 83 // the result.
84 webkit::ppapi::PPB_Graphics2D_Impl::ConvertToLogicalPixels( 84 webkit::ppapi::PPB_Graphics2D_Impl::ConvertToLogicalPixels(
85 1.0f / tests[i].scale, &r1, NULL); 85 1.0f / tests[i].scale, &r1, NULL);
86 EXPECT_TRUE(r1.Contains(orig)); 86 EXPECT_TRUE(r1.Contains(orig));
87 } 87 }
88 } 88 }
89 89
90 /*
91 Disabled because this doesn't run with the new proxy design.
92 TODO(brettw) Rewrite this test to use the new design.
93
90 #if !defined(USE_AURA) && (defined(OS_WIN) || defined(OS_LINUX)) 94 #if !defined(USE_AURA) && (defined(OS_WIN) || defined(OS_LINUX))
91 // Windows and Linux don't support scaled optimized plugin paints ATM. 95 // Windows and Linux don't support scaled optimized plugin paints ATM.
92 #define MAYBE_GetBitmap2xScale DISABLED_GetBitmap2xScale 96 #define MAYBE_GetBitmap2xScale DISABLED_GetBitmap2xScale
93 #else 97 #else
94 #define MAYBE_GetBitmap2xScale GetBitmap2xScale 98 #define MAYBE_GetBitmap2xScale GetBitmap2xScale
95 #endif 99 #endif
96 100
97 // Test that GetBitmapForOptimizedPluginPaint doesn't return a bitmap rect 101 // Test that GetBitmapForOptimizedPluginPaint doesn't return a bitmap rect
98 // that's bigger than the actual backing store bitmap. 102 // that's bigger than the actual backing store bitmap.
99 TEST_F(PpapiGraphics2DImplTest, MAYBE_GetBitmap2xScale) { 103 TEST_F(PpapiGraphics2DImplTest, MAYBE_GetBitmap2xScale) {
(...skipping 19 matching lines...) Expand all
119 EXPECT_EQ(0, location.x()); 123 EXPECT_EQ(0, location.x());
120 EXPECT_EQ(0, location.y()); 124 EXPECT_EQ(0, location.y());
121 EXPECT_EQ(gfx::ToFlooredInt(size.width / scale), location.width()); 125 EXPECT_EQ(gfx::ToFlooredInt(size.width / scale), location.width());
122 EXPECT_EQ(gfx::ToFlooredInt(size.height / scale), location.height()); 126 EXPECT_EQ(gfx::ToFlooredInt(size.height / scale), location.height());
123 EXPECT_EQ(0, clip.x()); 127 EXPECT_EQ(0, clip.x());
124 EXPECT_EQ(0, clip.y()); 128 EXPECT_EQ(0, clip.y());
125 EXPECT_EQ(size.width, clip.width()); 129 EXPECT_EQ(size.width, clip.width());
126 EXPECT_EQ(size.height, clip.height()); 130 EXPECT_EQ(size.height, clip.height());
127 EXPECT_EQ(scale, bitmap_scale); 131 EXPECT_EQ(scale, bitmap_scale);
128 } 132 }
133 */
129 134
130 } // namespace ppapi 135 } // namespace ppapi
131 } // namespace webkit 136 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.h ('k') | webkit/plugins/ppapi/ppb_image_data_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698