46 const PATH =
"http://localhost:" +
PORT +
"/object-state.sjs";
53 var sjsDir = do_get_file(
"data/sjs/");
54 srv.registerDirectory(
"/", sjsDir);
55 srv.registerContentType(
"sjs",
"sjs");
95 dumpn(
"*** initialStart");
98 do_throw(
"initialStart: initialStarted is true?!?!");
109 dumpn(
"*** initialStop");
117 do_throw(
"initialStop: initialStarted is false?!?!");
119 do_throw(
"initialStop: initialStopped is true?!?!");
121 do_throw(
"initialStop: intermediateStarted is false?!?!");
123 do_throw(
"initialStop: intermediateStopped is false?!?!");
133 dumpn(
"*** intermediateStart");
135 do_check_neq(
srv.getObjectState(
"object-state-test"),
null);
138 do_throw(
"intermediateStart: initialStarted is false?!?!");
139 if (intermediateStarted)
140 do_throw(
"intermediateStart: intermediateStarted is true?!?!");
142 intermediateStarted =
true;
148 dumpn(
"*** intermediateStop");
153 do_check_neq(
srv.getObjectState(
"object-state-test"),
null);
156 do_throw(
"intermediateStop: initialStarted is false?!?!");
157 if (!intermediateStarted)
158 do_throw(
"intermediateStop: intermediateStarted is false?!?!");
159 if (intermediateStopped)
160 do_throw(
"intermediateStop: intermediateStopped is true?!?!");
162 intermediateStopped =
true;
171 dumpn(
"*** triggerStart");
174 do_throw(
"triggerStart: initialStarted is false?!?!");
175 if (!intermediateStarted)
176 do_throw(
"triggerStart: intermediateStarted is false?!?!");
177 if (!intermediateStopped)
178 do_throw(
"triggerStart: intermediateStopped is false?!?!");
180 do_throw(
"triggerStart: triggerStarted is true?!?!");
182 triggerStarted =
true;
188 dumpn(
"*** triggerStop");
194 do_throw(
"triggerStop: initialStarted is false?!?!");
195 if (!intermediateStarted)
196 do_throw(
"triggerStop: intermediateStarted is false?!?!");
197 if (!intermediateStopped)
198 do_throw(
"triggerStop: intermediateStopped is false?!?!");
200 do_throw(
"triggerStop: triggerStarted is false?!?!");
202 do_throw(
"triggerStop: triggerStopped is false?!?!");
204 triggerStopped =
true;
216 do_throw(
"uh-oh, how are we being finished twice?!?!");
232 do_throw(
"checkForFinish: initialStarted is false?!?!");
233 if (!intermediateStarted)
234 do_throw(
"checkForFinish: intermediateStarted is false?!?!");
235 if (!intermediateStopped)
236 do_throw(
"checkForFinish: intermediateStopped is false?!?!");
238 do_throw(
"checkForFinish: triggerStarted is false?!?!");
242 srv.stop(do_test_finished);
268 channel.asyncOpen(
this,
null);
272 onStartRequest:
function(request, cx)
274 dumpn(
"*** HTTPTestLoader.onStartRequest for " + this._path);
276 var ch = request.QueryInterface(
Ci.nsIHttpChannel)
277 .QueryInterface(
Ci.nsIHttpChannelInternal);
287 do_throw(this._path +
": error in onStartRequest: " + e);
292 dumpn(
"!!! swallowing onStartRequest exception so onStopRequest is " +
296 onDataAvailable:
function(request, cx, inputStream,
offset,
count)
298 dumpn(
"*** HTTPTestLoader.onDataAvailable for " + this._path);
300 Array.prototype.push.apply(this._data,
303 onStopRequest:
function(request, cx, status)
305 dumpn(
"*** HTTPTestLoader.onStopRequest for " + this._path);
307 var ch = request.QueryInterface(
Ci.nsIHttpChannel)
308 .QueryInterface(
Ci.nsIHttpChannelInternal);
310 this._stop(ch, cx, status, this._data);
314 dumpn(
"*** QueryInterface: " + aIID);
316 if (aIID.equals(
Ci.nsIStreamListener) ||
317 aIID.equals(
Ci.nsIRequestObserver) ||
318 aIID.equals(
Ci.nsISupports))
320 throw Cr.NS_ERROR_NO_INTERFACE;
do_check_eq(typeof PlacesUtils,"object")
function stop(ch, cx, status, data)
function initialStop(ch, cx, status, data)
sbOSDControlService prototype QueryInterface
function HTTPTestLoader(path, start, stop)
function checkForFinish()
function triggerStop(ch, cx, status, data)
function triggerStart(ch, cx)
function makeChannel(url)
function intermediateStart(ch, cx)
function initialStart(ch, cx)
function intermediateStop(ch, cx, status, data)