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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 float frameDuration() const override { return 0; } 90 float frameDuration() const override { return 0; }
91 91
92 protected: 92 protected:
93 void useMockImageDecoderFactory() 93 void useMockImageDecoderFactory()
94 { 94 {
95 m_generator->setImageDecoderFactory(MockImageDecoderFactory::create(this , fullSize())); 95 m_generator->setImageDecoderFactory(MockImageDecoderFactory::create(this , fullSize()));
96 } 96 }
97 97
98 void addNewData(bool allDataReceived = false) 98 void addNewData(bool allDataReceived = false)
99 { 99 {
100 m_data->append("g", 1); 100 m_data->append("g", 1u);
101 m_generator->setData(m_data, allDataReceived); 101 m_generator->setData(m_data, allDataReceived);
102 } 102 }
103 103
104 void setFrameStatus(ImageFrame::Status status) { m_status = m_nextFrameStat us = status; } 104 void setFrameStatus(ImageFrame::Status status) { m_status = m_nextFrameStat us = status; }
105 void setNextFrameStatus(ImageFrame::Status status) { m_nextFrameStatus = st atus; } 105 void setNextFrameStatus(ImageFrame::Status status) { m_nextFrameStatus = st atus; }
106 void setFrameCount(size_t count) 106 void setFrameCount(size_t count)
107 { 107 {
108 m_frameCount = count; 108 m_frameCount = count;
109 if (count > 1) { 109 if (count > 1) {
110 m_generator.clear(); 110 m_generator.clear();
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 setFrameStatus(ImageFrame::FrameComplete); 266 setFrameStatus(ImageFrame::FrameComplete);
267 267
268 // Multi frame decoder should be removed. 268 // Multi frame decoder should be removed.
269 m_generator->decodeAndScale(2, imageInfo(), buffer, 100 * 4); 269 m_generator->decodeAndScale(2, imageInfo(), buffer, 100 * 4);
270 EXPECT_EQ(3, m_decodeRequestCount); 270 EXPECT_EQ(3, m_decodeRequestCount);
271 EXPECT_EQ(1, m_decodersDestroyed); 271 EXPECT_EQ(1, m_decodersDestroyed);
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698