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 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef CCTEST_H_ | 28 #ifndef CCTEST_H_ |
29 #define CCTEST_H_ | 29 #define CCTEST_H_ |
30 | 30 |
31 #include <memory> | 31 #include <memory> |
32 | 32 |
33 #include "include/libplatform/libplatform.h" | 33 #include "include/libplatform/libplatform.h" |
34 #include "include/v8-debug.h" | 34 #include "src/debug/debug-interface.h" |
35 #include "src/utils.h" | 35 #include "src/utils.h" |
36 #include "src/v8.h" | 36 #include "src/v8.h" |
37 #include "src/zone/accounting-allocator.h" | 37 #include "src/zone/accounting-allocator.h" |
38 | 38 |
39 namespace v8 { | 39 namespace v8 { |
40 namespace base { | 40 namespace base { |
41 | 41 |
42 class RandomNumberGenerator; | 42 class RandomNumberGenerator; |
43 | 43 |
44 } // namespace base | 44 } // namespace base |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 CHECK(result->IsNull()); | 540 CHECK(result->IsNull()); |
541 } | 541 } |
542 | 542 |
543 | 543 |
544 static inline void CheckDoubleEquals(double expected, double actual) { | 544 static inline void CheckDoubleEquals(double expected, double actual) { |
545 const double kEpsilon = 1e-10; | 545 const double kEpsilon = 1e-10; |
546 CHECK_LE(expected, actual + kEpsilon); | 546 CHECK_LE(expected, actual + kEpsilon); |
547 CHECK_GE(expected, actual - kEpsilon); | 547 CHECK_GE(expected, actual - kEpsilon); |
548 } | 548 } |
549 | 549 |
550 | 550 static v8::debug::DebugDelegate dummy_delegate; |
551 static void DummyDebugEventListener( | |
552 const v8::Debug::EventDetails& event_details) {} | |
553 | |
554 | 551 |
555 static inline void EnableDebugger(v8::Isolate* isolate) { | 552 static inline void EnableDebugger(v8::Isolate* isolate) { |
556 v8::Debug::SetDebugEventListener(isolate, &DummyDebugEventListener); | 553 v8::debug::SetDebugDelegate(isolate, &dummy_delegate); |
557 } | 554 } |
558 | 555 |
559 | 556 |
560 static inline void DisableDebugger(v8::Isolate* isolate) { | 557 static inline void DisableDebugger(v8::Isolate* isolate) { |
561 v8::Debug::SetDebugEventListener(isolate, nullptr); | 558 v8::debug::SetDebugDelegate(isolate, nullptr); |
562 } | 559 } |
563 | 560 |
564 | 561 |
565 static inline void EmptyMessageQueues(v8::Isolate* isolate) { | 562 static inline void EmptyMessageQueues(v8::Isolate* isolate) { |
566 while (v8::platform::PumpMessageLoop(v8::internal::V8::GetCurrentPlatform(), | 563 while (v8::platform::PumpMessageLoop(v8::internal::V8::GetCurrentPlatform(), |
567 isolate)) { | 564 isolate)) { |
568 } | 565 } |
569 } | 566 } |
570 | 567 |
571 class InitializedHandleScopeImpl; | 568 class InitializedHandleScopeImpl; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 601 |
605 const char* data() const { return data_; } | 602 const char* data() const { return data_; } |
606 | 603 |
607 size_t length() const { return strlen(data_); } | 604 size_t length() const { return strlen(data_); } |
608 | 605 |
609 private: | 606 private: |
610 const char* data_; | 607 const char* data_; |
611 }; | 608 }; |
612 | 609 |
613 #endif // ifndef CCTEST_H_ | 610 #endif // ifndef CCTEST_H_ |
OLD | NEW |