From 8140135d7b19584fd7c69576c1bd659242452dcf Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Mon, 25 Nov 2019 22:06:08 +1100 Subject: [PATCH] Fix Components.WebViewTestCase fixture setup and tear down Move config and web view creation into ::set_up, set them to null in ::tear_down. --- .../components/components-web-view-test-case.vala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/client/components/components-web-view-test-case.vala b/test/client/components/components-web-view-test-case.vala index 5ebdf4cc..514f9a16 100644 --- a/test/client/components/components-web-view-test-case.vala +++ b/test/client/components/components-web-view-test-case.vala @@ -13,8 +13,12 @@ public abstract class Components.WebViewTestCase : TestCase { protected WebViewTestCase(string name) { base(name); + } + + public override void set_up() { this.config = new Application.Configuration(Application.Client.SCHEMA_ID); this.config.enable_debug = true; + WebView.init_web_context( this.config, File.new_for_path(_BUILD_ROOT_DIR).get_child("src"), @@ -25,10 +29,13 @@ public abstract class Components.WebViewTestCase : TestCase { } catch (GLib.Error err) { assert_not_reached(); } + + this.test_view = set_up_test_view(); } - public override void set_up() { - this.test_view = set_up_test_view(); + protected override void tear_down() { + this.config = null; + this.test_view = null; } protected abstract V set_up_test_view();