summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests/perf: Add test for shutdown with open windowJonas Ådahl2023-04-201-0/+3
| | | | | | | This would without the applied fix trigger https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6536. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2722>
* tests: Set GNOME_SHELL_SESSION_MODE to userMarco Trevisan (Treviño)2023-03-191-0/+1
| | | | | | | This may not be unset in some environments, so let's override it with the default value. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2661>
* tests: Add default test setup with common env settingsMarco Trevisan (Treviño)2023-03-191-5/+1
| | | | | | | | | | Add common test environment variables to a default test setup so that they don't need to be repeated everywhere. Also ensures that we're always using the gsettings memory backend to never interfere with local environment. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2661>
* Add 'headless start' perf testJonas Ådahl2023-02-061-3/+13
| | | | | | | | This tests that GNOME Shell will launch sucessfully despite there being no monitors on startup, and successfully hide and then show the overview, once the monitor is connected. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2623>
* tests: Make perf tests non-parallelJonas Ådahl2023-02-061-0/+1
| | | | | | | We currently hard code the display name, and running multiple instances at the same time will probably just make things too slow for CI. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2623>
* tests/background-size: Get backend from globalJonas Ådahl2022-12-161-1/+1
| | | | Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
* tests: Fail on warnings tooJonas Ådahl2022-11-251-1/+1
| | | | | | | Getting warnings are always bad and means something is broken, we shouldn't pass the test suite with them. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
* tests/perf: Use custom solid background in testsJonas Ådahl2022-11-252-0/+3
| | | | | | | | They don't measure performance, and we don't want to have to install gnome-backgrounds, so bundle a solid color background image to use instead. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
* tests: Add test running basic perf testJonas Ådahl2022-11-251-0/+26
| | | | | | | | | This test runs all of GNOME Shell using the headless backend inside a mocked D-Bus environment. The basic test tests, well, basic things, like the panel menu, the overview, showing the app grid view, as well as going back to the session view. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
* tests: Add dbus runnerJonas Ådahl2022-11-253-0/+140
| | | | | | | This adds a dbus-runner ala meta-dbus-runner.py. It extends the one used in mutter, and adds various mocked services needed by gnome-shell. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
* tests: Add accounts_service mock serviceJonas Ådahl2022-11-251-0/+136
| | | | | | | | This is a shrunk copy of the accounts_service.py service previously found in upstream python-dbusmock. It also adds parental control properties to make GNOME Shell happy. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
* cleanup: Use deepUnpack() intead of deep_unpack()Alessandro Bono2022-08-101-1/+1
| | | | | | | | | | deep_unpack() is just a backwards compability alias for deepUnpack()[1]. The new name makes it more clear that this is not a C function, start to use it. [1] https://gitlab.gnome.org/GNOME/gjs/-/commit/13e662a29dbc762d5f4245c504f1e058788b516e Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2416>
* Adopt EventEmitter class instead of injecting Signal methodsEvan Welsh2022-07-041-5/+2
| | | | | | | | | | | | | | | Introduce a new class, EventEmitter, which implements signal handling for pure JavaScript classes. EventEmitter still utilizes GJS' addSignalMethods internally. EventEmitter allows static typechecking to understand the structure of event-emitting JS classes and makes creating child classes simpler. The name 'EventEmitter' mirrors a common name for this pattern in Node and in JS libraries. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2043>
* signalTracker: Explicitly register destroyable typesFlorian Müllner2022-03-061-1/+2
| | | | | | | | | | | | | | | | We currently assume that any '::destroy' signal on a GObject type has the semantics of the ClutterActor/GtkWidget signal, and should therefore result in all signals being disconnected. But we already have a case where the assumption doesn't hold: ShellWM uses '::destroy' for the closing animation of windows, and the ShellWM object itself remains very valid after the emission. So rather than making assumptions about '::destroy', check objects against a list of destroyable types that are explicitly registered as such. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2226>
* signalTracker: Add TransientSignalHolder classFlorian Müllner2022-03-051-0/+38
| | | | | | | | | | | | | | | There are cases where we want to connect to a number of signals for the lifetime of an object, but also other signals for a limited period (say: between show and hide). It is currently not possible to use disconnectObject() for the latter, because it will disconnect all signals. To address this use case, add a small class that can be used as a transient signal holder, while still benefiting from autocleanup by proxying the real owner. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2221>
* signalTracker: Provide monkey-patching for (dis)connectObject()Florian Müllner2022-03-042-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The module exports a `addObjectSignalMethods()` method that extends the provided prototype with `connectObject()` and `disconnectObject()` methods. In its simplest form, `connectObject()` looks like the regular `connect()` method, except for an additional parameter: ```js this._button.connectObject('clicked', () => this._onButtonClicked(), this); ``` The additional object can be used to disconnect all handlers on the instance that were connected with that object, similar to `g_signal_handlers_disconnect_by_data()` (which cannot be used from introspection). For objects that are subclasses of Clutter.Actor, that will happen automatically when the actor is destroyed, similar to `g_signal_connect_object()`. Finally, `connectObject()` allows to conveniently connect multiple signals at once, similar to `g_object_connect()`: ```js this._toggleButton.connect( 'clicked', () => this._onClicked(), 'notify::checked', () => this._onChecked(), this); ``` Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1953>
* build: Replace deprecated meson functionsFlorian Müllner2021-12-231-1/+1
| | | | | | | | | | | | | Replace deprecated functions with their direct replacements: - dep.get_pkgconfig_variable() → dep.get_variable() - prg.path() → prg.full_path() - source/build_root() → project_source/build_root() In one case we need meson.global_source_root() that was only added in meson 0.58, so bump the requirement to that. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2077>
* tests: Add unit test for highlighterSebastian Keller2021-12-222-1/+117
| | | | Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2033>
* util: Add a GNOME version comparison functionBastien Nocera2021-02-052-1/+53
| | | | | | | | | Add a function that can compare GNOME versions, including the new naming scheme for GNOME 40 and later. Used in https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3632 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1619>
* tests/background-size: Remove ClutterActor::paint signal handler usageJonas Dreßler2020-10-241-38/+5
| | | | | | | | | | | | | | | The background-size interactive test includes a test-case which uses the ClutterActor::paint signal to hijack the painting of the actor. We're removing that signal from Clutter, so remove that signal handler and paint the outer border unconditionally to mark the boundaries of the widget (the outer border actually never worked to force the cairo/cogl path). To fix the test, change it to not paint a border on the inner container in the useCairo=false case, which should make sure the cogl path gets used. Also remove the useless useCairo argument from addTestLine(). https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1479
* Remove ClutterAllocationFlagsJonas Dreßler2020-05-201-8/+6
| | | | | | | | | Those flags were removed from Clutter since they're pretty much unused, so remove them here, too. See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245 https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1245
* Use paint and pick context to get framebufferJonas Ådahl2019-12-031-11/+25
| | | | | | | | | | | Mutter and Clutter was changed to pass around the current target framebuffer via the paint context instead of via the deprecated Cogl framebuffer stack. The framebuffer stack has also been removed from Cogl so change to use the one in the paint context instead. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/827
* cleanup: Replace deprecated lower/raise callsFlorian Müllner2019-11-061-1/+1
| | | | | | | Those methods have been deprecated for a long time, so move to the drop-in replacement. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
* js: Replace Clutter.Actor.get_allocation_geometry()Florian Müllner2019-10-211-7/+7
| | | | | | The function was deprecated and has now been dropped from mutter. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/776
* cleanup: Use inheritance for Actor classes instead of compositionMarco Trevisan (Treviño)2019-10-161-1/+1
| | | | | | | | | | Remove the `this.actor = ...` and `this.actor._delegate = this` patterns in most of classes, by inheriting all the actor container classes. Uses interfaces when needed for making sure that multiple classes will implement some required methods or to avoid redefining the same code multiple times. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
* util: Handle trailing LTR/RTL markers in URLsFlorian Müllner2019-09-161-0/+2
| | | | | | | | Some electron apps apparently spread those generously over their notification text, so may sure to not include them accidentally in URLs. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1614
* cleanup: Stop using Mainloop moduleFlorian Müllner2019-09-123-9/+6
| | | | | | It is deprecated in favor of the regular GLib functions. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/718
* tests: Add Params.parse() unit testsFlorian Müllner2019-07-052-1/+33
| | | | | | | | Commit 46874eed0 accidentally changed the behavior of the function in an incompatible way. Before addressing the actual issue, add a reproducer to the unit tests to hopefully prevent future breakage. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/615
* style: Fix indentation errorsFlorian Müllner2019-07-021-2/+2
| | | | | | | | | | While we have some style inconsistencies - mostly regarding split lines, i.e. aligning to the first arguments vs. a four-space indent - there are a couple of places where the spacing is simply wrong. Fix those. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
* tests: Stop using global grabsJonas Dreßler2019-07-021-2/+0
| | | | | | | Global grabs are being removed from Clutter in favour of input device grabs. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/495
* style: Fix stray/missing semi-colonsFlorian Müllner2019-07-011-1/+1
| | | | | | Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
* cleanup: Use destructuring for imports from GIFlorian Müllner2019-02-0918-51/+20
| | | | | | This is *much* nicer than repetitive "imports.gi" lines ... https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
* tests: Work around import dependency loopFlorian Müllner2019-02-071-0/+1
| | | | | | | | | | | | | | The markup unit test currently fails with the following message: TypeError: class heritage MessageList.Message is not an object or null This is because MessageList imports other modules that end up importing MessageList themselves in order to inherit from one of its classes. But as the MessageList imports hasn't finished yet (it's still processing its own imports), that class hasn't been defined yet. Work around that by importing Main first, so that the importer can process imports in a proper order.
* cleanup: Port GObject classes to JS6 classesFlorian Müllner2019-01-251-22/+18
| | | | | | | | GJS added API for defining GObject classes with ES6 class syntax last cycle, use it to port the remaining Lang.Class classes to the new syntax. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
* cleanup: Remove obsolete Lang importsFlorian Müllner2019-01-223-3/+0
| | | | https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/350
* tests: Stop using Shell.GenericContainerGeorges Basile Stavracas Neto2018-10-081-53/+46
| | | | | | | | | The test doesn't look and behave like before, but they are already broken in master anyway. This commit makes it work without Shell.GenericContainer, but the test itself remains to be fixed. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
* utils: Simplify URL regex to only support one layer of parenthesesFlorian Müllner2018-04-131-1/+5
| | | | | | | | | | | | | The author of the original URL-matching regex warns[0] that the pattern may cause certain regex engines to lock up with certain input, namely patterns that contain parentheses. It turns out SpiderMonkey is affected, but rather than switching to the author's improved version (that is still crazy), sim- plify the pattern a bit by removing support for nested parentheses in URLs. Even a single pair of parentheses is extremely rare, so this is unlikely to make a noticeable difference (other than not locking up SpiderMonkey of course) ... [0] http://daringfireball.net/2010/07/improved_regex_for_matching_urls
* cleanup: Use Function.prototype.bind()Florian Müllner2018-02-211-9/+9
| | | | | | | | | | | When not using arrow notation with anonymous functions, we use Lang.bind() to bind `this` to named callbacks. However since ES5, this functionality is already provided by Function.prototype.bind() - in fact, Lang.bind() itself uses it when no extra arguments are specified. Just use the built-in function directly where possible, and use arrow notation in the few places where we pass additional arguments. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
* cleanup: Use arrow notation for anonymous functionsFlorian Müllner2018-02-217-18/+18
| | | | | | | | Arrow notation is great, use it consistently through-out the code base to bind `this` to anonymous functions, replacing the more overbose Lang.bind(this, function() {}). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
* cleanup: Use method syntaxFlorian Müllner2018-02-211-13/+13
| | | | | | | | Modern javascript has a short-hand for function properties, embrace it for better readability and to prepare for an eventual port to ES6 classes. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
* tests: Set calendar event sourceFlorian Müllner2018-02-211-0/+1
| | | | | | | | | Ever since commit e9e30138bd6 (2011!), the calendar only initialized the header at construction time. Set an event source to trigger an update of the content area, which is what the test is mainly intended for. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Fix import error in calendarFlorian Müllner2018-02-211-2/+2
| | | | | | | The Calendar module requires C_ at import time, which is only available after Environment.init() has been called. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Fix a warningFlorian Müllner2018-02-211-1/+3
| | | | | | | Gjs now warns about excess parameters passed to functions, so don't use Gtk.main_quit directly as signal callback. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Replace "for each" constructFlorian Müllner2018-02-212-4/+4
| | | | | | | It is no longer supported by recent mozjs versions, so replace it with a regular for loop to unbreak the tests. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Avoid redeclarations with letFlorian Müllner2018-02-212-9/+9
| | | | | | | Mozjs made this error fatal a while ago, so those tests were broken by gjs' JS engine updates. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Fix gnome-shell theme importFlorian Müllner2018-02-213-2/+5
| | | | | | | | | | | The current import rule fails in two ways: - commit c62e7a6a moved the theme's stylesheet to the builddir - since commit 49c4ba56, assets are addressed as resource:// URIs Fix both issues by loading and referencing the theme resource instead of the stylesheet itself. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38
* tests: Fix JS warningFlorian Müllner2017-10-041-1/+1
|
* build: Run unit tests on `meson test`Florian Müllner2017-10-041-1/+11
| | | | | | | Meson makes it easy to define unit tests, so hook up the existing ones. https://bugzilla.gnome.org/show_bug.cgi?id=786497
* build: Drop autotools supportFlorian Müllner2017-08-101-45/+0
| | | | | | Complete the switch to meson and drop autotools support ... https://bugzilla.gnome.org/show_bug.cgi?id=785153
* build: Support the meson build systemFlorian Müllner2017-07-202-1/+9
| | | | | | | | Meson is on track to replace autotools as the build system of choice, so support it in addition to autotools. If all goes well, we'll eventually be able to drop the latter ... https://bugzilla.gnome.org/show_bug.cgi?id=783229