Add some structure for interactive tests of UI components

js/ui/environment.js: Split out initial UI setup (Tweener initialization,
  ClutterContainer monkey-patching) into a separate file we can import from tests.

tests/: Directory for various types of tests
tests/run-test.sh: Shell script that to run tests with an appropriate
  environment set up.

tests/testcommon/: Common modules and data for tests
tests/interactive/: Interactive tests

tests/interactive/box-layout.js: A sample test of StLayout

https://bugzilla.gnome.org/show_bug.cgi?id=595987
This commit is contained in:
Owen W. Taylor
2009-09-18 15:51:15 -04:00
parent e37790fdf9
commit 55497899dd
11 changed files with 168 additions and 25 deletions

13
tests/testcommon/test.css Normal file
View File

@@ -0,0 +1,13 @@
@import "../../data/gnome-shell.css";
*.red {
background-color: red;
}
*.green {
background-color: green;
}
*.blue {
background-color: blue;
}

16
tests/testcommon/ui.js Normal file
View File

@@ -0,0 +1,16 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const St = imports.gi.St;
const Environment = imports.ui.environment;
function init() {
Clutter.init(null, null);
Environment.init();
let style = St.Style.get_default();
let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css";
style.load_from_file(stylesheetPath);
}