OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test_support.h" | 5 #include "testing/test_support.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #ifdef _WIN32 | 10 #include "testing/utils/path_service.h" |
11 #define PATH_SEPARATOR '\\' | |
12 #else | |
13 #define PATH_SEPARATOR '/' | |
14 #endif | |
15 | 11 |
16 #ifdef PDF_ENABLE_V8 | 12 #ifdef PDF_ENABLE_V8 |
17 #include "v8/include/libplatform/libplatform.h" | 13 #include "v8/include/libplatform/libplatform.h" |
18 #endif | 14 #endif |
19 | 15 |
20 namespace { | 16 namespace { |
21 | 17 |
22 #ifdef PDF_ENABLE_V8 | 18 #ifdef PDF_ENABLE_V8 |
23 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 19 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
24 // Returns the full path for an external V8 data file based on either | 20 // Returns the full path for an external V8 data file based on either |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 unsigned long pos, | 147 unsigned long pos, |
152 unsigned char* pBuf, | 148 unsigned char* pBuf, |
153 unsigned long size) { | 149 unsigned long size) { |
154 TestLoader* pLoader = static_cast<TestLoader*>(param); | 150 TestLoader* pLoader = static_cast<TestLoader*>(param); |
155 if (pos + size < pos || pos + size > pLoader->m_Len) | 151 if (pos + size < pos || pos + size > pLoader->m_Len) |
156 return 0; | 152 return 0; |
157 | 153 |
158 memcpy(pBuf, pLoader->m_pBuf + pos, size); | 154 memcpy(pBuf, pLoader->m_pBuf + pos, size); |
159 return 1; | 155 return 1; |
160 } | 156 } |
OLD | NEW |