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

Unified Diff: Source/core/platform/image-decoders/gif/GIFImageDecoderTest.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
Index: Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
index ad04dfa66c0005f941b81d0d908957c42f728e5c..b63e8c3eba4660dac03dd7df50ac3d4d49f50192 100644
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
@@ -32,7 +32,6 @@
#include "core/platform/image-decoders/gif/GIFImageDecoder.h"
-#include "core/platform/FileSystem.h"
#include "core/platform/SharedBuffer.h"
#include "public/platform/Platform.h"
#include "public/platform/WebData.h"
@@ -56,16 +55,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<GIFImageDecoder> createDecoder()

Powered by Google App Engine
This is Rietveld 408576698