File: testLegacyCairo.js

package info (click to toggle)
gjs 1.87.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,848 kB
  • sloc: cpp: 38,389; javascript: 31,953; ansic: 15,960; sh: 1,777; python: 791; xml: 137; makefile: 40
file content (26 lines) | stat: -rw-r--r-- 886 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 Philip Chimento <philip.chimento@gmail.com>

const Cairo = imports.cairo;
const giCairo = imports.gi.cairo;

describe('Cairo imported from legacy importer', function () {
    it('cairo default import', function () {
        // one from cairoNative, one from cairo JS.
        expect(typeof Cairo.Context).toBe('function');
        expect(typeof Cairo.Format).toBe('object');
    });

    // cairo doesn't have named exports
});

describe('Cairo imported via legacy GI importer', function () {
    it('has the same functionality as imports.cairo', function () {
        const surface = new giCairo.ImageSurface(Cairo.Format.ARGB32, 1, 1);
        void new giCairo.Context(surface);
    });

    it('has boxed types from the GIR file', function () {
        void new giCairo.RectangleInt();
    });
});