[geary/mjog/558-webkit-shared-process: 4/11] Fix Components.WebViewTestCase fixture setup and tear down
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/558-webkit-shared-process: 4/11] Fix Components.WebViewTestCase fixture setup and tear down
- Date: Tue, 26 Nov 2019 08:39:25 +0000 (UTC)
commit 8140135d7b19584fd7c69576c1bd659242452dcf
Author: Michael Gratton <mike vee net>
Date: Mon Nov 25 22:06:08 2019 +1100
Fix Components.WebViewTestCase fixture setup and tear down
Move config and web view creation into ::set_up, set them to null in
::tear_down.
test/client/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<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,12 +29,15 @@ public abstract class Components.WebViewTestCase<V> : TestCase {
} catch (GLib.Error err) {
assert_not_reached();
}
- }
- 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();
protected virtual void load_body_fixture(string html = "") {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]