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

Unified Diff: Source/web/tests/WebImageTest.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/web/tests/WebImageTest.cpp
diff --git a/Source/web/tests/WebImageTest.cpp b/Source/web/tests/WebImageTest.cpp
index 436c999b01473e6acabb0be70dd2d05073eb5e60..24e9ffa5c23c37c86acf1c1da0824d4783bba252 100644
--- a/Source/web/tests/WebImageTest.cpp
+++ b/Source/web/tests/WebImageTest.cpp
@@ -32,7 +32,6 @@
#include "public/platform/WebImage.h"
#include <gtest/gtest.h>
-#include "core/platform/FileSystem.h"
#include "core/platform/SharedBuffer.h"
#include "public/platform/Platform.h"
#include "public/platform/WebData.h"
@@ -50,16 +49,7 @@ static PassRefPtr<SharedBuffer> readFile(const char* fileName)
filePath.append("/Source/web/tests/data/");
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);
}
TEST(WebImageTest, PNGImage)
« no previous file with comments | « Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp ('k') | public/platform/WebFileUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698