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

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: rebase 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
« testing/embedder_test_timer_handling_delegate.h ('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..49232990bc36fc34e3bb4f051b0368d131074b3a 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -98,6 +98,22 @@ char* GetFileContents(const char* filename, size_t* retlen) {
return buffer;
}
+std::wstring GetWideString(FPDF_WIDESTRING wstr) {
+ if (!wstr)
+ return nullptr;
+
+ size_t characters = 0;
+ while (wstr[characters])
+ ++characters;
+
+ std::wstring platform_string(characters, L'\0');
+ for (size_t i = 0; i < characters + 1; ++i) {
+ const unsigned char* ptr = reinterpret_cast<const 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,
« testing/embedder_test_timer_handling_delegate.h ('K') | « testing/test_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698