| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // thread fuzzing test. In the thread fuzzing test it will | 182 // thread fuzzing test. In the thread fuzzing test it will |
| 183 // pseudorandomly select a successor thread and switch execution | 183 // pseudorandomly select a successor thread and switch execution |
| 184 // to that thread, suspending the current test. | 184 // to that thread, suspending the current test. |
| 185 class ApiTestFuzzer: public v8::base::Thread { | 185 class ApiTestFuzzer: public v8::base::Thread { |
| 186 public: | 186 public: |
| 187 void CallTest(); | 187 void CallTest(); |
| 188 | 188 |
| 189 // The ApiTestFuzzer is also a Thread, so it has a Run method. | 189 // The ApiTestFuzzer is also a Thread, so it has a Run method. |
| 190 virtual void Run(); | 190 virtual void Run(); |
| 191 | 191 |
| 192 enum PartOfTest { FIRST_PART, | 192 enum PartOfTest { |
| 193 SECOND_PART, | 193 FIRST_PART, |
| 194 THIRD_PART, | 194 SECOND_PART, |
| 195 FOURTH_PART, | 195 THIRD_PART, |
| 196 LAST_PART = FOURTH_PART }; | 196 FOURTH_PART, |
| 197 FIFTH_PART, |
| 198 SIXTH_PART, |
| 199 SEVENTH_PART, |
| 200 EIGHTH_PART, |
| 201 LAST_PART = EIGHTH_PART |
| 202 }; |
| 197 | 203 |
| 198 static void SetUp(PartOfTest part); | 204 static void SetUp(PartOfTest part); |
| 199 static void RunAllTests(); | 205 static void RunAllTests(); |
| 200 static void TearDown(); | 206 static void TearDown(); |
| 201 // This method switches threads if we are running the Threading test. | 207 // This method switches threads if we are running the Threading test. |
| 202 // Otherwise it does nothing. | 208 // Otherwise it does nothing. |
| 203 static void Fuzz(); | 209 static void Fuzz(); |
| 204 | 210 |
| 205 private: | 211 private: |
| 206 explicit ApiTestFuzzer(int num) | 212 explicit ApiTestFuzzer(int num) |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 591 |
| 586 // Prefixing the below with main_ reduces a lot of naming clashes. | 592 // Prefixing the below with main_ reduces a lot of naming clashes. |
| 587 i::Zone* main_zone() { return main_zone_.get(); } | 593 i::Zone* main_zone() { return main_zone_.get(); } |
| 588 | 594 |
| 589 private: | 595 private: |
| 590 v8::internal::AccountingAllocator allocator_; | 596 v8::internal::AccountingAllocator allocator_; |
| 591 std::unique_ptr<i::Zone> main_zone_; | 597 std::unique_ptr<i::Zone> main_zone_; |
| 592 }; | 598 }; |
| 593 | 599 |
| 594 #endif // ifndef CCTEST_H_ | 600 #endif // ifndef CCTEST_H_ |
| OLD | NEW |