tests: Don't use the default stage

https://bugzilla.gnome.org/show_bug.cgi?id=678737
This commit is contained in:
Jasper St. Pierre 2012-06-24 15:02:46 -04:00
parent 3ce9ad05b3
commit 0d82ce5210
16 changed files with 34 additions and 61 deletions

View File

@ -6,11 +6,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ user_resizable: true, width: 1024, height: 768 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.user_resizable = true;
stage.width = 1024;
stage.height = 768;
let vbox = new St.BoxLayout({ style: 'background: #ffee88;' }); let vbox = new St.BoxLayout({ style: 'background: #ffee88;' });
vbox.add_constraint(new Clutter.BindConstraint({ source: stage, vbox.add_constraint(new Clutter.BindConstraint({ source: stage,

View File

@ -5,10 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 640, height: 480 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 640;
stage.height = 480;
let vbox = new St.BoxLayout({ width: stage.width, let vbox = new St.BoxLayout({ width: stage.width,
height: stage.height, height: stage.height,

View File

@ -5,10 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 640, height: 480 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 640;
stage.height = 480;
let vbox = new St.BoxLayout({ width: stage.width, let vbox = new St.BoxLayout({ width: stage.width,
height: stage.height, height: stage.height,

View File

@ -5,10 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 640, height: 480 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 640;
stage.height = 480;
let vbox = new St.BoxLayout({ width: stage.width, let vbox = new St.BoxLayout({ width: stage.width,
height: stage.height, height: stage.height,

View File

@ -5,8 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,10 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 640, height: 480 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 640;
stage.height = 480;
let vbox = new St.BoxLayout({ width: stage.width, let vbox = new St.BoxLayout({ width: stage.width,
height: stage.height, height: stage.height,

View File

@ -7,10 +7,8 @@ const St = imports.gi.St;
const Calendar = imports.ui.calendar; const Calendar = imports.ui.calendar;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 400, height: 400 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = stage.height = 400;
stage.show();
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,8 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
let b = new St.BoxLayout({ vertical: true, let b = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -1,19 +1,14 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang; const Lang = imports.lang;
const St = imports.gi.St; const St = imports.gi.St;
const Calendar = imports.ui.calendar; const Calendar = imports.ui.calendar;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
Gtk.init(null, null); let stage = new Clutter.Stage({ width: 400, height: 400 });
UI.init(stage);
UI.init();
let stage = Clutter.Stage.get_default();
stage.width = stage.height = 400;
stage.show();
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,11 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 400;
stage.height = 700;
let b = new St.BoxLayout({ vertical: true, let b = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,8 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -251,10 +251,8 @@ SizingIllustrator.prototype = {
/****************************************************************************/ /****************************************************************************/
UI.init(); let stage = new Clutter.Stage({ width: 600, height: 600 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = 600;
stage.height = 600;
let mainBox = new St.BoxLayout({ width: stage.width, let mainBox = new St.BoxLayout({ width: stage.width,
height: stage.height, height: stage.height,

View File

@ -6,8 +6,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,9 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage({ width: 600, height: 600 });
let stage = Clutter.Stage.get_default(); UI.init(stage);
stage.width = stage.height = 600;
let vbox = new St.BoxLayout({ vertical: true, let vbox = new St.BoxLayout({ vertical: true,
width: stage.width, width: stage.width,

View File

@ -5,8 +5,8 @@ const St = imports.gi.St;
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
UI.init(); let stage = new Clutter.Stage();
let stage = Clutter.Stage.get_default(); UI.init(stage);
let hbox = new St.BoxLayout({ name: 'transition-container', let hbox = new St.BoxLayout({ name: 'transition-container',
reactive: true, reactive: true,

View File

@ -3,16 +3,13 @@
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib; const GLib = imports.gi.GLib;
const St = imports.gi.St; const St = imports.gi.St;
const Shell = imports.gi.Shell;
const Environment = imports.ui.environment; const Environment = imports.ui.environment;
function init() { function init(stage) {
Environment.init(); Environment.init();
let context = St.ThemeContext.get_for_stage(stage);
let stage = Clutter.Stage.get_default();
let context = St.ThemeContext.get_for_stage (stage);
let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css"; let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css";
let theme = new St.Theme ({ application_stylesheet: stylesheetPath }); let theme = new St.Theme({ application_stylesheet: stylesheetPath });
context.set_theme (theme); context.set_theme(theme);
} }