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

Side by Side Diff: ui/gfx/color_transform_unittest.cc

Issue 2224023002: Fix unitialized data field in QCMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot actual fuzzer file Created 4 years, 4 months 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
« no previous file with comments | « ui/gfx/color_transform_fuzzer.cc ('k') | ui/gfx/icc_profile.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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/logging.h" 5 #include "base/logging.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gfx/color_space.h" 7 #include "ui/gfx/color_space.h"
8 #include "ui/gfx/color_transform.h" 8 #include "ui/gfx/color_transform.h"
9 #include "ui/gfx/icc_profile.h" 9 #include "ui/gfx/icc_profile.h"
10 #include "ui/gfx/transform.h" 10 #include "ui/gfx/transform.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x74, 0x65, 0x78, 0x74, 329 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x74, 0x65, 0x78, 0x74,
330 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 330 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68,
331 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x6f, 331 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x6f,
332 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x43, 0x6f, 332 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x43, 0x6f,
333 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x75, 0x6d, 0x2c, 0x20, 0x32, 0x30, 333 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x75, 0x6d, 0x2c, 0x20, 0x32, 0x30,
334 0x30, 0x39, 0x00, 0x00, 0x73, 0x66, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, 334 0x30, 0x39, 0x00, 0x00, 0x73, 0x66, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00,
335 0x00, 0x01, 0x0c, 0x44, 0x00, 0x00, 0x05, 0xdf, 0xff, 0xff, 0xf3, 0x26, 335 0x00, 0x01, 0x0c, 0x44, 0x00, 0x00, 0x05, 0xdf, 0xff, 0xff, 0xf3, 0x26,
336 0x00, 0x00, 0x07, 0x94, 0x00, 0x00, 0xfd, 0x8f, 0xff, 0xff, 0xfb, 0xa1, 336 0x00, 0x00, 0x07, 0x94, 0x00, 0x00, 0xfd, 0x8f, 0xff, 0xff, 0xfb, 0xa1,
337 0xff, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x03, 0xdb, 0x00, 0x00, 0xc0, 0x75}; 337 0xff, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x03, 0xdb, 0x00, 0x00, 0xc0, 0x75};
338 338
339 // MSan detects an uninitialized read in QCMS. https://crbug.com/635042 339 TEST(SimpleColorSpace, BT709toSRGBICC) {
340 #if defined(MEMORY_SANITIZER)
341 #define MAYBE_BT709toSRGBICC DISABLED_BT709toSRGBICC
342 #else
343 #define MAYBE_BT709toSRGBICC BT709toSRGBICC
344 #endif
345 TEST(SimpleColorSpace, MAYBE_BT709toSRGBICC) {
346 ICCProfile srgb_icc = ICCProfile::FromData( 340 ICCProfile srgb_icc = ICCProfile::FromData(
347 reinterpret_cast<char*>(srgb_icc_data), arraysize(srgb_icc_data)); 341 reinterpret_cast<char*>(srgb_icc_data), arraysize(srgb_icc_data));
348 342
349 ColorSpace bt709 = ColorSpace::CreateREC709(); 343 ColorSpace bt709 = ColorSpace::CreateREC709();
350 ColorSpace sRGB = srgb_icc.GetColorSpace(); 344 ColorSpace sRGB = srgb_icc.GetColorSpace();
351 std::unique_ptr<ColorTransform> t(ColorTransform::NewColorTransform( 345 std::unique_ptr<ColorTransform> t(ColorTransform::NewColorTransform(
352 bt709, sRGB, ColorTransform::Intent::ABSOLUTE)); 346 bt709, sRGB, ColorTransform::Intent::ABSOLUTE));
353 347
354 ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f); 348 ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f);
355 t->transform(&tmp, 1); 349 t->transform(&tmp, 1);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 testing::ValuesIn(all_ranges))); 487 testing::ValuesIn(all_ranges)));
494 488
495 INSTANTIATE_TEST_CASE_P( 489 INSTANTIATE_TEST_CASE_P(
496 C, 490 C,
497 ColorSpaceTest, 491 ColorSpaceTest,
498 testing::Combine(testing::ValuesIn(all_primaries), 492 testing::Combine(testing::ValuesIn(all_primaries),
499 testing::Values(ColorSpace::TransferID::BT709), 493 testing::Values(ColorSpace::TransferID::BT709),
500 testing::ValuesIn(all_matrices), 494 testing::ValuesIn(all_matrices),
501 testing::ValuesIn(all_ranges))); 495 testing::ValuesIn(all_ranges)));
502 } // namespace 496 } // namespace
OLDNEW
« no previous file with comments | « ui/gfx/color_transform_fuzzer.cc ('k') | ui/gfx/icc_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698