Remove rtc::Location from SendTask test helper

that rtc::Location parameter was used only as extra information for the
RTC_CHECKs directly in the function, thus call stack of the crash should
provide all the information about the caller.

Bug: webrtc:11318
Change-Id: Iec6dd2c5de547f3e1601647a614be7ce57a55734
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270920
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37748}
This commit is contained in:
Danil Chapovalov
2022-08-11 12:26:09 +02:00
committed by WebRTC LUCI CQ
parent e2d829cf77
commit e519f38eaa
37 changed files with 352 additions and 470 deletions

View File

@ -204,7 +204,7 @@ template <class T>
std::unique_ptr<T> NewObjectCreatedOnTaskQueue() {
std::unique_ptr<T> obj;
webrtc::TaskQueueForTest queue("NewObjectCreatedOnTaskQueue");
queue.SendTask([&] { obj = std::make_unique<T>(); }, RTC_FROM_HERE);
queue.SendTask([&] { obj = std::make_unique<T>(); });
return obj;
}
@ -226,13 +226,11 @@ TEST(WeakPtrTest, WeakPtrInitiateAndUseOnDifferentThreads) {
// Create weak ptr on main thread
WeakPtr<Target> weak_ptr = target->factory.GetWeakPtr();
webrtc::TaskQueueForTest queue("queue");
queue.SendTask(
[&] {
// Dereference and invalide weak_ptr on another thread.
EXPECT_EQ(weak_ptr.get(), target.get());
target.reset();
},
RTC_FROM_HERE);
queue.SendTask([&] {
// Dereference and invalide weak_ptr on another thread.
EXPECT_EQ(weak_ptr.get(), target.get());
target.reset();
});
}
} // namespace rtc