blob: 5ea7c0b0aaac86efbe59221474f6f479ccb3a818 (
plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/**
* @file
* Test that svgz (= compressed SVG) import/drag-and-drop
* is working: https://gitlab.com/inkscape/inkscape/issues/906 .
*
*/
/*
* Authors:
* Shlomi Fish
*
* Copyright (C) 2020 Authors
*/
#include "doc-per-case-test.h"
#include <glibmm.h>
#include "extension/db.h"
#include "extension/find_extension_by_mime.h"
#include "extension/internal/svgz.h"
#include "path-prefix.h"
#include "preferences.h"
#include "gtest/gtest.h"
class SvgzImportTest : public DocPerCaseTest {
public:
SvgzImportTest() {}
void TestBody()
{
ASSERT_TRUE(_doc != nullptr);
ASSERT_TRUE(_doc->getRoot() != nullptr);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setBool("/dialogs/import/ask_svg", true);
prefs->setBool("/options/onimport", true);
auto ext = Inkscape::Extension::find_by_mime("image/svg+xml-compressed");
ext->set_gui(true);
auto fn = Glib::build_filename(INKSCAPE_EXAMPLESDIR, "tiger.svgz");
auto imod = dynamic_cast<Inkscape::Extension::Input *>(ext);
auto svg_mod = (new Inkscape::Extension::Internal::Svg);
ASSERT_TRUE(svg_mod->open(imod, fn.c_str()) != nullptr);
}
~SvgzImportTest() override {}
};
TEST_F(SvgzImportTest, Eq)
{
SvgzImportTest foo;
foo.TestBody();
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
|