Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: test/unittests/libplatform/default-platform-unittest.cc

Issue 1221083004: Fix memory-leak in default platform implementation of delayed tasks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/libplatform/default-platform.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/libplatform/default-platform.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698