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

Unified Diff: Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp

Issue 22645008: Add WebKitUnitTestSupport::readFromFile and deprecate all PlatformFileHandle related methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp ('k') | Source/web/tests/WebImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
index da9ee8e8e3f372feda912ee8d6ce3cb9a2538791..002ae08d4c9e26aec93d419078993eda362bb1ff 100644
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
@@ -33,7 +33,6 @@
#include "core/platform/image-decoders/webp/WEBPImageDecoder.h"
#include "RuntimeEnabledFeatures.h"
-#include "core/platform/FileSystem.h"
#include "core/platform/SharedBuffer.h"
#include "public/platform/Platform.h"
#include "public/platform/WebData.h"
@@ -58,16 +57,7 @@ PassRefPtr<SharedBuffer> readFile(const char* fileName)
String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
filePath.append(fileName);
- long long fileSize;
- if (!getFileSize(filePath, fileSize))
- return 0;
-
- PlatformFileHandle handle = openFile(filePath, OpenForRead);
- int fileLength = static_cast<int>(fileSize);
- Vector<char> buffer(fileLength);
- readFromFile(handle, buffer.data(), fileLength);
- closeFile(handle);
- return SharedBuffer::adoptVector(buffer);
+ return Platform::current()->unitTestSupport()->readFromFile(filePath);
}
PassOwnPtr<WEBPImageDecoder> createDecoder()
@@ -443,4 +433,3 @@ TEST_F(AnimatedWebPTests, resumePartialDecodeAfterClearFrameBufferCache)
}
#endif
-
« no previous file with comments | « Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp ('k') | Source/web/tests/WebImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698