From dd8c06f2c59c7b7f3a872e613bce82b3686993c3 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 15 Feb 2017 00:43:09 +0000 Subject: [PATCH] tests: load required version of Clutter/Gtk early --- tests/interactive/background-repeat.js | 4 ++-- tests/interactive/background-size.js | 3 ++- tests/interactive/border-radius.js | 4 ++-- tests/interactive/border-width.js | 4 ++-- tests/interactive/borders.js | 4 ++-- tests/interactive/box-layout.js | 4 ++-- tests/interactive/box-shadow-animated.js | 4 ++-- tests/interactive/box-shadows.js | 4 ++-- tests/interactive/calendar.js | 3 ++- tests/interactive/css-fonts.js | 4 ++-- tests/interactive/entry.js | 3 ++- tests/interactive/icons.js | 4 ++-- tests/interactive/inline-style.js | 4 ++-- tests/interactive/scroll-view-sizing.js | 4 ++-- tests/interactive/scrolling.js | 4 ++-- tests/interactive/transitions.js | 4 ++-- tests/testcommon/ui.js | 5 +++++ 17 files changed, 37 insertions(+), 29 deletions(-) diff --git a/tests/interactive/background-repeat.js b/tests/interactive/background-repeat.js index 3e1c869f6..2b83411c4 100644 --- a/tests/interactive/background-repeat.js +++ b/tests/interactive/background-repeat.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage({ width: 640, height: 480 }); UI.init(stage); diff --git a/tests/interactive/background-size.js b/tests/interactive/background-size.js index f803260b1..e31326977 100644 --- a/tests/interactive/background-size.js +++ b/tests/interactive/background-size.js @@ -1,10 +1,11 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Cogl = imports.gi.Cogl; const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; function test() { let stage = new Clutter.Stage({ user_resizable: true, width: 1024, height: 768 }); diff --git a/tests/interactive/border-radius.js b/tests/interactive/border-radius.js index 865c512bf..3b7d3d306 100644 --- a/tests/interactive/border-radius.js +++ b/tests/interactive/border-radius.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage({ width: 640, height: 480 }); UI.init(stage); diff --git a/tests/interactive/border-width.js b/tests/interactive/border-width.js index 4ac118c94..cb84187e0 100644 --- a/tests/interactive/border-width.js +++ b/tests/interactive/border-width.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage({ width: 640, height: 480 }); UI.init(stage); diff --git a/tests/interactive/borders.js b/tests/interactive/borders.js index 97d049d50..23212e4fb 100644 --- a/tests/interactive/borders.js +++ b/tests/interactive/borders.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage({ width: 640, height: 480 }); UI.init(stage); diff --git a/tests/interactive/box-layout.js b/tests/interactive/box-layout.js index 36460f847..5eb83a46b 100644 --- a/tests/interactive/box-layout.js +++ b/tests/interactive/box-layout.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/interactive/box-shadow-animated.js b/tests/interactive/box-shadow-animated.js index 2dc7ceae3..a334c38f9 100644 --- a/tests/interactive/box-shadow-animated.js +++ b/tests/interactive/box-shadow-animated.js @@ -1,13 +1,13 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; const Mainloop = imports.mainloop; const GLib = imports.gi.GLib; const Lang = imports.lang; -const UI = imports.testcommon.ui; - const DELAY = 2000; function resize_animated(label) { diff --git a/tests/interactive/box-shadows.js b/tests/interactive/box-shadows.js index e80cb1b75..4a14df1c9 100644 --- a/tests/interactive/box-shadows.js +++ b/tests/interactive/box-shadows.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage({ width: 640, height: 480 }); UI.init(stage); diff --git a/tests/interactive/calendar.js b/tests/interactive/calendar.js index 18db19348..a54b562d5 100644 --- a/tests/interactive/calendar.js +++ b/tests/interactive/calendar.js @@ -1,11 +1,12 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const Lang = imports.lang; const St = imports.gi.St; const Calendar = imports.ui.calendar; -const UI = imports.testcommon.ui; function test() { let stage = new Clutter.Stage({ width: 400, height: 400 }); diff --git a/tests/interactive/css-fonts.js b/tests/interactive/css-fonts.js index 89af66704..56c19055d 100644 --- a/tests/interactive/css-fonts.js +++ b/tests/interactive/css-fonts.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/interactive/entry.js b/tests/interactive/entry.js index df93676f7..35c4f1184 100644 --- a/tests/interactive/entry.js +++ b/tests/interactive/entry.js @@ -1,11 +1,12 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const Lang = imports.lang; const St = imports.gi.St; const Calendar = imports.ui.calendar; -const UI = imports.testcommon.ui; function test() { let stage = new Clutter.Stage({ width: 400, height: 400 }); diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js index 64cf898d1..39ef09e6b 100644 --- a/tests/interactive/icons.js +++ b/tests/interactive/icons.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/interactive/inline-style.js b/tests/interactive/inline-style.js index b8fe9aaff..1bd35f9f8 100644 --- a/tests/interactive/inline-style.js +++ b/tests/interactive/inline-style.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/interactive/scroll-view-sizing.js b/tests/interactive/scroll-view-sizing.js index a6d09ea81..d8c6fdc9e 100644 --- a/tests/interactive/scroll-view-sizing.js +++ b/tests/interactive/scroll-view-sizing.js @@ -1,13 +1,13 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const Gtk = imports.gi.Gtk; const Lang = imports.lang; const Shell = imports.gi.Shell; const St = imports.gi.St; -const UI = imports.testcommon.ui; - // This is an interactive test of the sizing behavior of StScrollView. It // may be interesting in the future to split out the two classes at the // top into utility classes for testing the sizing behavior of other diff --git a/tests/interactive/scrolling.js b/tests/interactive/scrolling.js index 1c3964607..ca84fe90b 100644 --- a/tests/interactive/scrolling.js +++ b/tests/interactive/scrolling.js @@ -1,11 +1,11 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const Gtk = imports.gi.Gtk; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/interactive/transitions.js b/tests/interactive/transitions.js index 6855a5f6a..acb5db479 100644 --- a/tests/interactive/transitions.js +++ b/tests/interactive/transitions.js @@ -1,10 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const UI = imports.testcommon.ui; + const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const UI = imports.testcommon.ui; - function test() { let stage = new Clutter.Stage(); UI.init(stage); diff --git a/tests/testcommon/ui.js b/tests/testcommon/ui.js index b66b0cdca..51c136a39 100644 --- a/tests/testcommon/ui.js +++ b/tests/testcommon/ui.js @@ -1,5 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const Config = imports.misc.config; + +imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION; +imports.gi.versions.Gtk = '3.0'; + const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib;