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

Unified Diff: webkit/support/test_webkit_platform_support.cc

Issue 22738002: Implement UnitTestSupport::readFromFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | « webkit/support/test_webkit_platform_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/test_webkit_platform_support.cc
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index 6eecfedd0d058906e5715d657c61ba8d55e684aa..c74f343eea178b2b99181a47d6795007b69729b0 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/metrics/stats_counters.h"
#include "base/path_service.h"
@@ -345,3 +346,12 @@ WebKit::WebLayerTreeView*
return createLayerTreeViewForTesting();
}
+WebKit::WebData TestWebKitPlatformSupport::readFromFile(
+ const WebKit::WebString& path) {
+ base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path);
+
+ std::string buffer;
+ file_util::ReadFileToString(file_path, &buffer);
+
+ return WebKit::WebData(buffer.data(), buffer.size());
+}
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698