[GLIB] Remove delete on destroy GMainLoopSources
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WTF / glib / GMainLoopSource.cpp
index 54991eeeb63904fa796e78b7dc5ddc107f31f388..276683c620644ad680dcc339473e6ec380c9cd42 100644 (file)
@@ -494,54 +494,4 @@ TEST(WTF_GMainLoopSource, DestroyCallbacksAfterReschedulingDuringDispatch)
     destroyCallbacksAfterReschedulingDuringDispatch<ThreadSafeTestingContext>();
 }
 
-TEST(WTF_GMainLoopSource, DeleteOnDestroySources)
-{
-    // Testing the delete-on-destroy sources is very limited. There's no good way
-    // of testing that the GMainLoopSource objects are deleted when their GSource
-    // is destroyed.
-
-    struct TestingContext {
-        GMainLoopSourceTest<GMainLoopSource> test;
-        unsigned callbackCallCount = 0;
-        bool destroyCallbackCalled = false;
-    } context;
-
-    {
-        TestingContext context;
-
-        GMainLoopSource::scheduleAndDeleteOnDestroy("[Test] DeleteOnDestroy",
-            [&] {
-                context.callbackCallCount++;
-            }, G_PRIORITY_DEFAULT,
-            [&] {
-                EXPECT_FALSE(context.destroyCallbackCalled);
-                context.destroyCallbackCalled = true;
-            });
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-        EXPECT_EQ(1, context.callbackCallCount);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-
-    {
-        TestingContext context;
-
-        GMainLoopSource::scheduleAndDeleteOnDestroy("[Test] DeleteOnDestroy",
-            std::function<bool ()>([&] {
-                context.callbackCallCount++;
-                return context.callbackCallCount != 3;
-            }), G_PRIORITY_DEFAULT,
-            [&] {
-                EXPECT_FALSE(context.destroyCallbackCalled);
-                context.destroyCallbackCalled = true;
-            });
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-        EXPECT_EQ(3, context.callbackCallCount);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-}
-
 } // namespace TestWebKitAPI