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

Unified Diff: testing/test_support.h

Issue 1416713002: Consolidate test support code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Duplicated lines in GN Created 5 years, 2 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 | « testing/embedder_test.cpp ('k') | testing/test_support.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/test_support.h
diff --git a/testing/test_support.h b/testing/test_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..1018421ba77190d3898c69057a7423778bb5d217
--- /dev/null
+++ b/testing/test_support.h
@@ -0,0 +1,44 @@
+// Copyright 2015 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TESTING_EMBEDDER_TEST_SUPPORT_H_
+#define TESTING_EMBEDDER_TEST_SUPPORT_H_
+
+#include <stdlib.h>
+#include <string>
+
+#ifdef PDF_ENABLE_V8
+#include "v8/include/libplatform/libplatform.h"
+#include "v8/include/v8.h"
+#endif
+
+// Reads the entire contents of a file into a newly malloc'd buffer.
+char* GetFileContents(const char* filename, size_t* retlen);
+
+#ifdef PDF_ENABLE_V8
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+bool InitializeV8ForPDFium(const std::string& exe_path,
+ const std::string& bin_dir,
+ v8::StartupData* natives_blob,
+ v8::StartupData* snapshot_blob,
+ v8::Platform** platform);
+#else // V8_USE_EXTERNAL_STARTUP_DATA
+bool InitializeV8ForPDFium(v8::Platform** platform);
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+#endif // PDF_ENABLE_V8
+
+class TestLoader {
+ public:
+ TestLoader(const char* pBuf, size_t len);
+ static int GetBlock(void* param,
+ unsigned long pos,
+ unsigned char* pBuf,
+ unsigned long size);
+
+ private:
+ const char* const m_pBuf;
+ const size_t m_Len;
+};
+
+#endif // TESTING_EMBEDDER_TEST_SUPPORT_H_
« no previous file with comments | « testing/embedder_test.cpp ('k') | testing/test_support.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698