Fix Components.WebViewTestCase fixture setup and tear down

Move config and web view creation into ::set_up, set them to null in
::tear_down.
This commit is contained in:
Michael Gratton 2019-11-25 22:06:08 +11:00 committed by Michael James Gratton
parent ceb9c9764a
commit 8140135d7b

View file

@ -13,8 +13,12 @@ public abstract class Components.WebViewTestCase<V> : 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<V> : 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();