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

Side by Side Diff: Source/core/platform/graphics/BitmapImageTest.cpp

Issue 61773005: Rename WebKit namespace to blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual void didDraw(const Image*) OVERRIDE { } 53 virtual void didDraw(const Image*) OVERRIDE { }
54 virtual bool shouldPauseAnimation(const Image*) OVERRIDE { return false; } 54 virtual bool shouldPauseAnimation(const Image*) OVERRIDE { return false; }
55 virtual void animationAdvanced(const Image*) OVERRIDE { } 55 virtual void animationAdvanced(const Image*) OVERRIDE { }
56 virtual void changedInRect(const Image*, const IntRect&) { } 56 virtual void changedInRect(const Image*, const IntRect&) { }
57 57
58 int m_lastDecodedSizeChangedDelta; 58 int m_lastDecodedSizeChangedDelta;
59 }; 59 };
60 60
61 static PassRefPtr<SharedBuffer> readFile(const char* fileName) 61 static PassRefPtr<SharedBuffer> readFile(const char* fileName)
62 { 62 {
63 String filePath = WebKit::Platform::current()->unitTestSupport()->webKit RootDir(); 63 String filePath = blink::Platform::current()->unitTestSupport()->webKitR ootDir();
64 filePath.append(fileName); 64 filePath.append(fileName);
65 return WebKit::Platform::current()->unitTestSupport()->readFromFile(file Path); 65 return blink::Platform::current()->unitTestSupport()->readFromFile(fileP ath);
66 } 66 }
67 67
68 // Accessors to BitmapImage's protected methods. 68 // Accessors to BitmapImage's protected methods.
69 void destroyDecodedData(bool destroyAll) { m_image->destroyDecodedData(destr oyAll); } 69 void destroyDecodedData(bool destroyAll) { m_image->destroyDecodedData(destr oyAll); }
70 size_t frameCount() { return m_image->frameCount(); } 70 size_t frameCount() { return m_image->frameCount(); }
71 void setCurrentFrame(size_t frame) { m_image->m_currentFrame = frame; } 71 void setCurrentFrame(size_t frame) { m_image->m_currentFrame = frame; }
72 size_t frameDecodedSize(size_t frame) { return m_image->m_frames[frame].m_fr ameBytes; } 72 size_t frameDecodedSize(size_t frame) { return m_image->m_frames[frame].m_fr ameBytes; }
73 size_t decodedFramesCount() const { return m_image->m_frames.size(); } 73 size_t decodedFramesCount() const { return m_image->m_frames.size(); }
74 74
75 void loadImage(const char* fileName) 75 void loadImage(const char* fileName)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 { 125 {
126 loadImage("/LayoutTests/fast/images/resources/animated-10color.gif"); 126 loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
127 size_t totalSize = decodedSize(); 127 size_t totalSize = decodedSize();
128 EXPECT_GT(totalSize, 0u); 128 EXPECT_GT(totalSize, 0u);
129 destroyDecodedData(true); 129 destroyDecodedData(true);
130 EXPECT_EQ(-static_cast<int>(totalSize), m_imageObserver.m_lastDecodedSizeCha ngedDelta); 130 EXPECT_EQ(-static_cast<int>(totalSize), m_imageObserver.m_lastDecodedSizeCha ngedDelta);
131 EXPECT_EQ(0u, decodedSize()); 131 EXPECT_EQ(0u, decodedSize());
132 } 132 }
133 133
134 } // namespace 134 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698