OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <fcntl.h> | 5 #include <fcntl.h> |
6 #include <poll.h> | 6 #include <poll.h> |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
10 #include <sys/time.h> | 10 #include <sys/time.h> |
(...skipping 23 matching lines...) Expand all Loading... |
34 if (task_d != 0 || task_stat.st_nlink < 3) | 34 if (task_d != 0 || task_stat.st_nlink < 3) |
35 return -1; | 35 return -1; |
36 const int num_threads = task_stat.st_nlink - 2; | 36 const int num_threads = task_stat.st_nlink - 2; |
37 return num_threads; | 37 return num_threads; |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 namespace sandbox { | 42 namespace sandbox { |
43 | 43 |
| 44 bool IsAndroid() { |
| 45 #if defined(OS_ANDROID) |
| 46 return true; |
| 47 #else |
| 48 return false; |
| 49 #endif |
| 50 } |
| 51 |
| 52 bool IsArchitectureArm() { |
| 53 #if defined(ARCH_CPU_ARM_FAMILY) |
| 54 return true; |
| 55 #else |
| 56 return false; |
| 57 #endif |
| 58 } |
| 59 |
44 // TODO(jln): figure out why base/.../dynamic_annotations.h's | 60 // TODO(jln): figure out why base/.../dynamic_annotations.h's |
45 // RunningOnValgrind() cannot link. | 61 // RunningOnValgrind() cannot link. |
46 bool IsRunningOnValgrind() { return RUNNING_ON_VALGRIND; } | 62 bool IsRunningOnValgrind() { return RUNNING_ON_VALGRIND; } |
47 | 63 |
48 static const int kExpectedValue = 42; | 64 static const int kExpectedValue = 42; |
49 static const int kIgnoreThisTest = 43; | 65 static const int kIgnoreThisTest = 43; |
50 static const int kExitWithAssertionFailure = 1; | 66 static const int kExitWithAssertionFailure = 1; |
51 static const int kExitForTimeout = 2; | 67 static const int kExitForTimeout = 2; |
52 | 68 |
53 static void SigAlrmHandler(int) { | 69 static void SigAlrmHandler(int) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 fflush(stderr); | 252 fflush(stderr); |
237 _exit(kExitWithAssertionFailure); | 253 _exit(kExitWithAssertionFailure); |
238 } | 254 } |
239 | 255 |
240 void UnitTests::IgnoreThisTest() { | 256 void UnitTests::IgnoreThisTest() { |
241 fflush(stderr); | 257 fflush(stderr); |
242 _exit(kIgnoreThisTest); | 258 _exit(kIgnoreThisTest); |
243 } | 259 } |
244 | 260 |
245 } // namespace | 261 } // namespace |
OLD | NEW |