OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium 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 "testing/android/native_test_util.h" | 5 #include "testing/android/native_test_util.h" |
6 | 6 |
7 #include <android/log.h> | 7 #include <android/log.h> |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
11 #include <sys/types.h> | 11 #include <sys/types.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/string_util.h" | |
18 #include "base/strings/string_tokenizer.h" | 17 #include "base/strings/string_tokenizer.h" |
| 18 #include "base/strings/string_util.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const char kLogTag[] = "chromium"; | 22 const char kLogTag[] = "chromium"; |
23 | 23 |
24 void AndroidLogError(const char* format, ...) { | 24 void AndroidLogError(const char* format, ...) { |
25 va_list args; | 25 va_list args; |
26 va_start(args, format); | 26 va_start(args, format); |
27 __android_log_vprint(ANDROID_LOG_ERROR, kLogTag, format, args); | 27 __android_log_vprint(ANDROID_LOG_ERROR, kLogTag, format, args); |
28 va_end(args); | 28 va_end(args); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 for (int i = 0; i < argc; ++i) { | 81 for (int i = 0; i < argc; ++i) { |
82 (*argv)[i] = const_cast<char*>(args[i].c_str()); | 82 (*argv)[i] = const_cast<char*>(args[i].c_str()); |
83 } | 83 } |
84 (*argv)[argc] = NULL; // argv must be NULL terminated. | 84 (*argv)[argc] = NULL; // argv must be NULL terminated. |
85 | 85 |
86 return argc; | 86 return argc; |
87 } | 87 } |
88 | 88 |
89 } // namespace native_test_util | 89 } // namespace native_test_util |
90 } // namespace testing | 90 } // namespace testing |
OLD | NEW |