| OLD | NEW |
| 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 "ppapi/tests/test_browser_font.h" | 5 #include "ppapi/tests/test_browser_font.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 7 #include <string.h> | 8 #include <string.h> |
| 8 | 9 |
| 10 #include "ppapi/cpp/image_data.h" |
| 11 #include "ppapi/cpp/trusted/browser_font_trusted.h" |
| 9 #include "ppapi/tests/test_utils.h" | 12 #include "ppapi/tests/test_utils.h" |
| 10 #include "ppapi/tests/testing_instance.h" | 13 #include "ppapi/tests/testing_instance.h" |
| 11 #include "ppapi/cpp/image_data.h" | |
| 12 #include "ppapi/cpp/trusted/browser_font_trusted.h" | |
| 13 | 14 |
| 14 REGISTER_TEST_CASE(BrowserFont); | 15 REGISTER_TEST_CASE(BrowserFont); |
| 15 | 16 |
| 16 bool TestBrowserFont::Init() { | 17 bool TestBrowserFont::Init() { |
| 17 return true; | 18 return true; |
| 18 } | 19 } |
| 19 | 20 |
| 20 void TestBrowserFont::RunTests(const std::string& filter) { | 21 void TestBrowserFont::RunTests(const std::string& filter) { |
| 21 RUN_TEST(FontFamilies, filter); | 22 RUN_TEST(FontFamilies, filter); |
| 22 RUN_TEST(Measure, filter); | 23 RUN_TEST(Measure, filter); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 for (int i = 0; i < kSize.GetArea(); ++i) { | 193 for (int i = 0; i < kSize.GetArea(); ++i) { |
| 193 if ((pixels[i] & kRGBMask) != kRGBMask) | 194 if ((pixels[i] & kRGBMask) != kRGBMask) |
| 194 ++text_pixels; | 195 ++text_pixels; |
| 195 if ((pixels[i] & kAlphaMask) == kAlphaMask) | 196 if ((pixels[i] & kAlphaMask) == kAlphaMask) |
| 196 ++opaque_pixels; | 197 ++opaque_pixels; |
| 197 } | 198 } |
| 198 ASSERT_GT(text_pixels, 0); | 199 ASSERT_GT(text_pixels, 0); |
| 199 ASSERT_EQ(opaque_pixels, kSize.GetArea()); | 200 ASSERT_EQ(opaque_pixels, kSize.GetArea()); |
| 200 PASS(); | 201 PASS(); |
| 201 } | 202 } |
| OLD | NEW |