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

Unified Diff: third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp

Issue 1686263008: Add utility method for WebString to base::FilePath conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase! Created 4 years, 10 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 | « third_party/WebKit/Source/platform/testing/DEPS ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
diff --git a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
index cb771fa855bfd9a4528abe7c227209a3bf96b790..9db6c760b9c7bd5556f0b39defc717ddf2d59993 100644
--- a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
+++ b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
@@ -30,7 +30,9 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "platform/SharedBuffer.h"
+#include "public/platform/FilePathConversion.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebString.h"
#include "public/platform/WebTaskRunner.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebTraceLocation.h"
@@ -57,9 +59,7 @@ String blinkRootDir()
PassRefPtr<SharedBuffer> readFromFile(const String& path)
{
- StringUTF8Adaptor utf8(path);
- base::FilePath filePath = base::FilePath::FromUTF8Unsafe(
- std::string(utf8.data(), utf8.length()));
+ base::FilePath filePath = blink::WebStringToFilePath(path);
std::string buffer;
base::ReadFileToString(filePath, &buffer);
return SharedBuffer::create(buffer.data(), buffer.size());
« no previous file with comments | « third_party/WebKit/Source/platform/testing/DEPS ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698