%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// Navigation helper for the test iframe. Queues navigation actions and
// callbacks, then executes them serially with respect to async. This is to
// avoid deep nesting of callbacks in tests.
//
// If a `then`able object is returned from a callback, then the navigation will
// resume only after the promise has been resolved.
//
// After last successful navigation, asyncTest is automatically resumed.
//
// Usage:
//
// navigate(this.frame)
// .pjax(pjaxOptions, function(frame){ ... }
// .back(-1, function(frame){ ... }
//
function navigate(frame) {
var queue = []
var api = {}
api.pjax = function(options, callback) {
queue.push([options, callback])
return api
}
api.back = api.pjax
var workOff = function() {
var item = queue.shift()
if (!item) {
start()
return
}
var target = item[0], callback = item[1]
frame.$(frame.document).one("pjax:end", function() {
var promise = callback && callback(frame)
if (promise && typeof promise.then == "function") promise.then(workOff)
else setTimeout(workOff, 0)
})
if (typeof target == "number") {
frame.history.go(target)
} else {
frame.$.pjax(target)
}
}
setTimeout(workOff, 0)
return api
}
// A poor man's Promise implementation. Only resolvable promises with no
// reject/catch support.
function PoorMansPromise(setup) {
var result, callback, i = 0, callbacks = []
setup(function(_result) {
result = _result
while (callback = callbacks[i++]) callback(result)
})
this.then = function(done) {
if (i == 0) callbacks.push(done)
else setTimeout(function(){ done(result) }, 0)
return this
}
}