comparison js/black-box.js @ 99:544d339d2b4c

Added the beginnings of a black-box app that can be used to generate/run functional tests.
author Atul Varma <avarma@mozilla.com>
date Tue, 27 Apr 2010 09:59:15 -0700
parents
children c486d35fad27
comparison
equal deleted inserted replaced
98:97fc889dbed4 99:544d339d2b4c
1 function onDashboardLoaded(dashboard, options) {
2 var require = Require.build();
3
4 // Needed for Firebug, which won't log iframe errors to the console.
5 $(dashboard).error(
6 function(event) {
7 console.warn("An error occurred in the dashboard iframe.");
8 });
9
10 var moduleExports = {};
11 var dbrequire = dashboard.Require.build(dashboard.Require.modules,
12 moduleExports);
13 options.cache = require("mocks/cache").create();
14 options.Bugzilla = require("mocks/bugzilla").create(options.Bugzilla);
15 dbrequire("date-utils").now = function() {
16 return new Date("Tue Apr 27 2010 09:00:00 GMT");
17 };
18 dbrequire("app/loader").init(moduleExports, options);
19 }
20
21 $(window).ready(
22 function() {
23 var iframe = $("#dashboard").get(0);
24 iframe.src = "index.html?testing=1";
25 });