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

Side by Side Diff: testing/test_support.cpp

Issue 1411403012: Merge to XFA: Add path service to retrieve test data directory at run time so tests can be run from… (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: remove a blank line 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 unified diff | Download patch
« no previous file with comments | « testing/embedder_test.cpp ('k') | testing/utils/path_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « testing/embedder_test.cpp ('k') | testing/utils/path_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698