mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
uri-asset: Fix retrieving a relocated asset sync twice
Add a simple test for that.
This commit is contained in:
parent
a2b0dd3859
commit
564505e16f
2 changed files with 15 additions and 2 deletions
|
@ -455,6 +455,7 @@ asset_ready_cb (GESAsset * source, GAsyncResult * res, RequestSyncData * data)
|
||||||
gchar *possible_uri = ges_uri_asset_try_update_id (data->error, source);
|
gchar *possible_uri = ges_uri_asset_try_update_id (data->error, source);
|
||||||
|
|
||||||
if (possible_uri) {
|
if (possible_uri) {
|
||||||
|
ges_asset_try_proxy (source, possible_uri);
|
||||||
g_clear_error (&data->error);
|
g_clear_error (&data->error);
|
||||||
ges_asset_request_async (GES_TYPE_URI_CLIP, possible_uri, NULL,
|
ges_asset_request_async (GES_TYPE_URI_CLIP, possible_uri, NULL,
|
||||||
(GAsyncReadyCallback) asset_ready_cb, data);
|
(GAsyncReadyCallback) asset_ready_cb, data);
|
||||||
|
|
|
@ -31,13 +31,14 @@ from gi.repository import GES # noqa
|
||||||
import unittest # noqa
|
import unittest # noqa
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
from . import common
|
||||||
from .common import GESSimpleTimelineTest # noqa
|
from .common import GESSimpleTimelineTest # noqa
|
||||||
|
|
||||||
Gst.init(None)
|
Gst.init(None)
|
||||||
GES.init()
|
GES.init()
|
||||||
|
|
||||||
|
|
||||||
class TestTimeline(unittest.TestCase):
|
class TestTimeline(GESSimpleTimelineTest):
|
||||||
|
|
||||||
def test_request_relocated_assets_sync(self):
|
def test_request_relocated_assets_sync(self):
|
||||||
path = os.path.join(__file__, "../../../", "png.png")
|
path = os.path.join(__file__, "../../../", "png.png")
|
||||||
|
@ -47,4 +48,15 @@ class TestTimeline(unittest.TestCase):
|
||||||
GES.add_missing_uri_relocation_uri(Gst.filename_to_uri(os.path.join(__file__, "../../assets")), False)
|
GES.add_missing_uri_relocation_uri(Gst.filename_to_uri(os.path.join(__file__, "../../assets")), False)
|
||||||
path = os.path.join(__file__, "../../", "png.png")
|
path = os.path.join(__file__, "../../", "png.png")
|
||||||
self.assertEqual(GES.UriClipAsset.request_sync(Gst.filename_to_uri(path)).props.id,
|
self.assertEqual(GES.UriClipAsset.request_sync(Gst.filename_to_uri(path)).props.id,
|
||||||
Gst.filename_to_uri(os.path.join(__file__, "../../assets/png.png")))
|
Gst.filename_to_uri(os.path.join(__file__, "../../assets/png.png")))
|
||||||
|
|
||||||
|
def test_request_relocated_twice(self):
|
||||||
|
mainloop = common.create_main_loop()
|
||||||
|
|
||||||
|
GES.add_missing_uri_relocation_uri(Gst.filename_to_uri(os.path.join(__file__, "../../")), True)
|
||||||
|
proj = GES.Project.new()
|
||||||
|
|
||||||
|
asset = proj.create_asset_sync("file:///png.png", GES.UriClip)
|
||||||
|
self.assertIsNotNone(asset)
|
||||||
|
asset = proj.create_asset_sync("file:///png.png", GES.UriClip)
|
||||||
|
self.assertIsNotNone(asset)
|
Loading…
Reference in a new issue