| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 : Thread(isolate, "ApiTestFuzzer"), | 91 : Thread(isolate, "ApiTestFuzzer"), |
| 92 test_number_(num), | 92 test_number_(num), |
| 93 gate_(v8::internal::OS::CreateSemaphore(0)), | 93 gate_(v8::internal::OS::CreateSemaphore(0)), |
| 94 active_(true) { | 94 active_(true) { |
| 95 } | 95 } |
| 96 ~ApiTestFuzzer() { delete gate_; } | 96 ~ApiTestFuzzer() { delete gate_; } |
| 97 | 97 |
| 98 // The ApiTestFuzzer is also a Thread, so it has a Run method. | 98 // The ApiTestFuzzer is also a Thread, so it has a Run method. |
| 99 virtual void Run(); | 99 virtual void Run(); |
| 100 | 100 |
| 101 enum PartOfTest { FIRST_PART, SECOND_PART }; | 101 enum PartOfTest { FIRST_PART, |
| 102 SECOND_PART, |
| 103 THIRD_PART, |
| 104 FOURTH_PART, |
| 105 LAST_PART = FOURTH_PART }; |
| 102 | 106 |
| 103 static void Setup(PartOfTest part); | 107 static void Setup(PartOfTest part); |
| 104 static void RunAllTests(); | 108 static void RunAllTests(); |
| 105 static void TearDown(); | 109 static void TearDown(); |
| 106 // This method switches threads if we are running the Threading test. | 110 // This method switches threads if we are running the Threading test. |
| 107 // Otherwise it does nothing. | 111 // Otherwise it does nothing. |
| 108 static void Fuzz(); | 112 static void Fuzz(); |
| 109 private: | 113 private: |
| 110 static bool fuzzing_; | 114 static bool fuzzing_; |
| 111 static int tests_being_run_; | 115 static int tests_being_run_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 207 } |
| 204 | 208 |
| 205 | 209 |
| 206 // Helper function that compiles and runs the source. | 210 // Helper function that compiles and runs the source. |
| 207 static inline v8::Local<v8::Value> CompileRun(const char* source) { | 211 static inline v8::Local<v8::Value> CompileRun(const char* source) { |
| 208 return v8::Script::Compile(v8::String::New(source))->Run(); | 212 return v8::Script::Compile(v8::String::New(source))->Run(); |
| 209 } | 213 } |
| 210 | 214 |
| 211 | 215 |
| 212 #endif // ifndef CCTEST_H_ | 216 #endif // ifndef CCTEST_H_ |
| OLD | NEW |