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

Unified Diff: testing/test_support.cpp

Issue 1424743006: Make JS app.setTimeOut() work again. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 1 month 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
« fpdfsdk/src/javascript/JS_Object.cpp ('K') | « testing/test_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/test_support.cpp
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index 611ba5d580641df8c5a64c31c273ab83e630a0a9..1bbfed7fb4cd79bddd3358e2f91bf4e210706f36 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -98,6 +98,20 @@ char* GetFileContents(const char* filename, size_t* retlen) {
return buffer;
}
+wchar_t* GetWideString(FPDF_WIDESTRING wstr) {
+ size_t characters = 0;
+ while (wstr[characters])
+ ++characters;
+
+ wchar_t* platform_string =
+ static_cast<wchar_t*>(malloc((characters + 1) * sizeof(wchar_t)));
+ for (size_t i = 0; i < characters + 1; ++i) {
+ unsigned char* ptr = (unsigned char*)&wstr[i];
+ platform_string[i] = ptr[0] + 256 * ptr[1];
+ }
+ return platform_string;
+}
+
#ifdef PDF_ENABLE_V8
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
bool InitializeV8ForPDFium(const std::string& exe_path,
« fpdfsdk/src/javascript/JS_Object.cpp ('K') | « testing/test_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698