File: GnomeApp.t

package info (click to toggle)
libgnome2-perl 1.045-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 608 kB
  • ctags: 12
  • sloc: perl: 1,145; ansic: 16; makefile: 4
file content (51 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl -w
use strict;
use Gnome2;

use constant TESTS => 13;
use Test::More tests => TESTS;

# $Id$

###############################################################################

SKIP: {
  our $application;
  do "t/TestBoilerplate";

  #############################################################################

  my $app = Gnome2::App -> new("test", "Test");
  isa_ok($app, "Gnome2::App");

  is($app -> prefix, "/test/");
  isa_ok($app -> dock, "Gnome2::Bonobo::Dock");
  isa_ok($app -> vbox, "Gtk2::VBox");
  isa_ok($app -> layout, "Gnome2::Bonobo::DockLayout");
  isa_ok($app -> accel_group, "Gtk2::AccelGroup");

  $app -> set_menus(Gtk2::MenuBar -> new());
  isa_ok($app -> menubar, "Gtk2::MenuBar");

  $app -> set_toolbar(Gtk2::Toolbar -> new());

  $app -> set_statusbar(Gtk2::Label -> new("Statusbar"));
  # $app -> set_statusbar_custom(Gtk2::HBox -> new(0, 0), Gtk2::Label -> new("Statusbar"));
  isa_ok($app -> statusbar, "Gtk2::Label");

  $app -> set_contents(Gtk2::Label -> new("Content"));
  isa_ok($app -> contents, "Gtk2::Label");

  $app -> add_toolbar(Gtk2::Toolbar -> new(), "toolbar", "normal", "top", 1, 1, 0);
  isa_ok($app -> add_docked(Gtk2::Toolbar -> new(), "dock", "normal", "left", 1, 2, 0), "Gnome2::Bonobo::DockItem");

  my $dock_item = Gnome2::Bonobo::DockItem -> new("dock item", "normal");
  $dock_item -> add(Gtk2::Toolbar -> new());
  $app -> add_dock_item($dock_item, "right", 1, 3, 0);

  $app -> enable_layout_config(0);
  is($app -> get_enable_layout_config, 0);

  isa_ok($app -> get_dock(), "Gnome2::Bonobo::Dock");
  isa_ok($app -> get_dock_item_by_name("dock item"), "Gnome2::Bonobo::DockItem");
}