OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project 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 "src/libplatform/default-platform.h" | 5 #include "src/libplatform/default-platform.h" |
6 #include "testing/gmock/include/gmock/gmock.h" | 6 #include "testing/gmock/include/gmock/gmock.h" |
7 | 7 |
8 using testing::InSequence; | 8 using testing::InSequence; |
9 using testing::StrictMock; | 9 using testing::StrictMock; |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 platform.CallOnForegroundThread(isolate, task3); | 104 platform.CallOnForegroundThread(isolate, task3); |
105 | 105 |
106 EXPECT_CALL(*task2, Run()); | 106 EXPECT_CALL(*task2, Run()); |
107 EXPECT_CALL(*task2, Die()); | 107 EXPECT_CALL(*task2, Die()); |
108 EXPECT_TRUE(platform.PumpMessageLoop(isolate)); | 108 EXPECT_TRUE(platform.PumpMessageLoop(isolate)); |
109 EXPECT_CALL(*task3, Run()); | 109 EXPECT_CALL(*task3, Run()); |
110 EXPECT_CALL(*task3, Die()); | 110 EXPECT_CALL(*task3, Die()); |
111 EXPECT_TRUE(platform.PumpMessageLoop(isolate)); | 111 EXPECT_TRUE(platform.PumpMessageLoop(isolate)); |
112 } | 112 } |
113 | 113 |
| 114 |
| 115 TEST(DefaultPlatformTest, PendingDelayedTasksAreDestroyedOnShutdown) { |
| 116 InSequence s; |
| 117 |
| 118 int dummy; |
| 119 Isolate* isolate = reinterpret_cast<Isolate*>(&dummy); |
| 120 |
| 121 { |
| 122 DefaultPlatformWithMockTime platform; |
| 123 StrictMock<MockTask>* task = new StrictMock<MockTask>; |
| 124 platform.CallDelayedOnForegroundThread(isolate, task, 10); |
| 125 EXPECT_CALL(*task, Die()); |
| 126 } |
| 127 } |
| 128 |
| 129 |
114 } // namespace platform | 130 } // namespace platform |
115 } // namespace v8 | 131 } // namespace v8 |
OLD | NEW |