gnome-shell/tests/interactive/entry.js
Jasper St. Pierre c7196a519f tests: Run each test in a function
As the global object of a context is rooted, if we want the GC to act
on these objects we need to take them out of the globals.

https://bugzilla.gnome.org/show_bug.cgi?id=678737
2012-06-24 19:20:48 -04:00

29 lines
854 B
JavaScript

// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Lang = imports.lang;
const St = imports.gi.St;
const Calendar = imports.ui.calendar;
const UI = imports.testcommon.ui;
function test() {
let stage = new Clutter.Stage({ width: 400, height: 400 });
UI.init(stage);
let vbox = new St.BoxLayout({ vertical: true,
width: stage.width,
height: stage.height,
style: 'padding: 10px; spacing: 10px; font: 15px sans-serif;' });
stage.add_actor(vbox);
let entry = new St.Entry({ style: 'border: 1px solid black;' });
vbox.add(entry,
{ expand: true,
y_fill: false, y_align: St.Align.MIDDLE });
entry.grab_key_focus();
UI.main(stage);
}
test();