This commit is contained in:
2020-02-01 16:47:12 +07:00
commit 4c619ad6e6
16739 changed files with 3329179 additions and 0 deletions

106
vendor/bower-asset/yii2-pjax/test/app.rb vendored Normal file
View File

@@ -0,0 +1,106 @@
require 'sinatra'
require 'json'
set :public_folder, File.dirname(settings.root)
enable :static
jquery_version = '3.2'
helpers do
def pjax?
env['HTTP_X_PJAX'] && !params[:layout]
end
def title(str)
if pjax?
"<title>#{str}</title>"
else
@title = str
nil
end
end
define_method(:jquery_version) do
jquery_version
end
end
after do
if pjax?
response.headers['X-PJAX-URL'] ||= request.url
response.headers['X-PJAX-Version'] = 'v1'
end
end
get '/' do
jquery_version = params[:jquery] if params[:jquery]
erb :qunit
end
get '/env.html' do
erb :env, :layout => !pjax?
end
post '/env.html' do
erb :env, :layout => !pjax?
end
put '/env.html' do
erb :env, :layout => !pjax?
end
delete '/env.html' do
erb :env, :layout => !pjax?
end
get '/redirect.html' do
if params[:anchor]
path = "/hello.html##{params[:anchor]}"
if pjax?
response.headers['X-PJAX-URL'] = uri(path)
status 200
else
redirect path
end
else
redirect "/hello.html"
end
end
get '/timeout.html' do
if pjax?
sleep 1
erb :timeout, :layout => false
else
erb :timeout
end
end
post '/timeout.html' do
if pjax?
sleep 1
erb :timeout, :layout => false
else
status 500
erb :boom
end
end
get '/boom.html' do
status 500
erb :boom, :layout => !pjax?
end
get '/boom_sans_pjax.html' do
status 500
erb :boom_sans_pjax, :layout => false
end
get '/:page.html' do
erb :"#{params[:page]}", :layout => !pjax?
end
get '/some-&-path/hello.html' do
erb :hello, :layout => !pjax?
end

View File

@@ -0,0 +1 @@
window.externalScriptLoaded()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,87 @@
var fs = require('fs')
var suites = require('system').args.slice(1)
function print(s) {
fs.write('/dev/stdout', s, 'w')
}
var page = require('webpage').create()
page.onConsoleMessage = function(msg) {
console.log(msg)
}
page.onError = function(msg) {
console.error('ERROR: ' + msg)
}
var timeoutId = null
function deferTimeout() {
if (timeoutId) clearTimeout(timeoutId)
timeoutId = setTimeout(function() {
console.error('Timeout')
phantom.exit(1)
}, 3000)
}
var endresult = 0
function runSuite() {
var suite = suites.shift()
if (!suite) {
phantom.exit(endresult)
return
}
page.open(suite, function() {
deferTimeout()
var interval = setInterval(function() {
var tests = page.evaluate(function() {
var results = []
var els = document.getElementById('qunit-tests').children
for (var i = 0; i < els.length; i++) {
var test = els[i]
if (test.className !== 'running' && !test.recorded) {
test.recorded = true
if (test.className === 'pass') results.push('.')
else if (test.className === 'fail') results.push('F')
}
}
return results
})
for (var i = 0; i < tests.length; i++) {
deferTimeout()
print(tests[i])
}
var result = page.evaluate(function() {
var testresult = document.getElementById('qunit-testresult')
var els = document.getElementById('qunit-tests').children
if (testresult.innerText.match(/completed/)) {
console.log('')
for (var i = 0; i < els.length; i++) {
var test = els[i]
if (test.className === 'fail') {
console.error(test.innerText)
}
}
console.log(testresult.innerText)
return parseInt(testresult.getElementsByClassName('failed')[0].innerText)
}
})
if (result != null) {
endresult = result
clearInterval(interval)
runSuite()
}
}, 100)
})
}
runSuite()

View File

@@ -0,0 +1,246 @@
if ($.support.pjax) {
module("$.fn.pjax", {
setup: function() {
var self = this
stop()
window.iframeLoad = function(frame) {
self.frame = frame
window.iframeLoad = $.noop
start()
}
$("#qunit-fixture").append("<iframe src='home.html'>")
},
teardown: function() {
delete window.iframeLoad
}
})
asyncTest("pushes new url", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("replaces container html from response data", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.$("iframe").attr('title'), "YouTube video player")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("sets title to response title tag", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.document.title, "dinosaurs")
start()
})
frame.$("a[href='/dinosaurs.html']").trigger('click')
})
asyncTest("uses second argument as options", function() {
var frame = this.frame
frame.$("#main").pjax("a", {container: "#main", push: true}).on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("uses second argument as container and third as options", function() {
var frame = this.frame
frame.$("body").pjax("a", "#main", {push: true}).on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("defaults to data-pjax container", function() {
var frame = this.frame
frame.$("a").attr('data-pjax', "#main")
frame.$("body").pjax("a")
frame.$("#main").on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("sets relatedTarget to clicked element", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var link = frame.$("a[href='/dinosaurs.html']")[0]
frame.$("#main").on("pjax:end", function(event, xhr, options) {
equal(link, event.relatedTarget)
start()
})
frame.$(link).click()
})
asyncTest("doesn't ignore left click", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var event = frame.$.Event('click')
event.which = 0
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(event.isDefaultPrevented())
start()
})
asyncTest("ignores middle clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var event = frame.$.Event('click')
event.which = 3
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores command clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
event.metaKey = true
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores ctrl clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
event.ctrlKey = true
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores cross origin links", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
frame.$("a[href='https://www.google.com/']").trigger(event)
notEqual(event.result, false)
start()
})
asyncTest("ignores same page anchors", function() {
var event, frame = this.frame
frame.$("#main").pjax("a")
event = frame.$.Event('click')
frame.$("a[href='#main']").trigger(event)
equal(event.isDefaultPrevented(), false)
event = frame.$.Event('click')
frame.$("a[href='#']").trigger(event)
equal(event.isDefaultPrevented(), false)
start()
})
asyncTest("ignores same page anchors from URL that has hash", function() {
var event, frame = this.frame
frame.window.location = "#foo"
frame.$("#main").pjax("a")
event = frame.$.Event('click')
frame.$("a[href='#main']").trigger(event)
equal(event.isDefaultPrevented(), false)
event = frame.$.Event('click')
frame.$("a[href='#']").trigger(event)
equal(event.isDefaultPrevented(), false)
start()
})
asyncTest("ignores event with prevented default", function() {
var frame = this.frame
var eventIgnored = true
frame.$("#main").pjax("a").on("pjax:click", function() {
eventIgnored = false
})
frame.$("a[href='/dinosaurs.html']").on("click", function(event) {
event.preventDefault()
setTimeout(function() {
ok(eventIgnored, "Event with prevented default ignored")
start()
}, 10)
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("triggers pjax:click event from link", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:click", function(event, options) {
ok(event)
equal(options.container, "#main")
ok(options.url.match("/dinosaurs.html"))
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("triggers pjax:clicked event from link", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:clicked", function(event, options) {
ok(event)
equal(options.container, "#main")
ok(options.url.match("/dinosaurs.html"))
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
}

View File

@@ -0,0 +1,66 @@
// 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
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,461 @@
// $.pjax fallback tests should run on both pushState and
// non-pushState compatible browsers.
$.each([true, false], function() {
var disabled = this == false
var s = disabled ? " (disabled)" : ""
var ua = navigator.userAgent
var safari = ua.match("Safari") && !ua.match("Chrome") && !ua.match("Edge")
var chrome = ua.match("Chrome") && !ua.match("Edge")
module("$.pjax fallback"+s, {
setup: function() {
var self = this
stop()
this.loaded = function(frame) {
self.frame = frame
self.loaded = $.noop
start()
}
window.iframeLoad = function(frame) {
setTimeout(function() {
if (disabled && frame.$ && frame.$.pjax) frame.$.pjax.disable()
self.loaded(frame)
}, 0)
}
$("#qunit-fixture").append("<iframe src='home.html'>")
},
teardown: function() {
delete window.iframeLoad
}
})
asyncTest("sets new url"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
start()
}
frame.$.pjax({
url: "hello.html",
container: "#main"
})
})
asyncTest("sets new url for function"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
start()
}
frame.$.pjax({
url: function() { return "hello.html" },
container: "#main"
})
})
asyncTest("updates container html"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
equal(frame.$("#main p").html(), "Hello!")
start()
}
frame.$.pjax({
url: "/hello.html",
container: "#main"
})
})
asyncTest("sets title to response <title>"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
equal(frame.document.title, "Hello")
start()
}
frame.$.pjax({
url: "/hello.html",
container: "#main"
})
})
asyncTest("sends correct HTTP referer"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
var referer = frame.document.getElementById("referer").textContent
ok(referer.match("/home.html"), referer)
start()
}
frame.$.pjax({
url: "/referer.html",
container: "#main"
})
})
asyncTest("scrolls to top of the page"+s, function() {
var frame = this.frame
frame.window.scrollTo(0, 100)
equal(frame.window.pageYOffset, 100)
this.loaded = function(frame) {
equal(frame.window.pageYOffset, 0)
start()
}
frame.$.pjax({
url: "/long.html",
container: "#main"
})
})
asyncTest("scrolls to anchor at top page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.location.pathname, "/anchor.html")
equal(frame.location.hash, "#top")
equal(frame.window.pageYOffset, 8)
start()
}, 100)
}
frame.$.pjax({
url: "/anchor.html#top",
container: "#main"
})
if (disabled) {
equal(frame.location.pathname, "/home.html")
equal(frame.location.href.indexOf("#"), -1)
} else {
equal(frame.location.pathname, "/anchor.html")
equal(frame.location.hash, "#top")
}
})
asyncTest("empty anchor doesn't scroll page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 0)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#",
container: "#main"
})
})
asyncTest("scrolls to anchor at bottom page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 10008)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#bottom",
container: "#main"
})
})
asyncTest("scrolls to named encoded anchor"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 10008)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#%62%6F%74%74%6F%6D",
container: "#main"
})
})
asyncTest("sets GET method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
container: "#main"
})
})
asyncTest("sets POST method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
container: "#main"
})
})
asyncTest("sets PUT method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "PUT")
start()
}
frame.$.pjax({
type: 'PUT',
url: "env.html",
container: "#main"
})
})
asyncTest("sets DELETE method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "DELETE")
start()
}
frame.$.pjax({
type: 'DELETE',
url: "env.html",
container: "#main"
})
})
asyncTest("GET with data object"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=bar")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
equal(env['rack.request.query_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: {foo: 'bar'},
container: "#main"
})
})
asyncTest("POST with data object"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
equal(env['rack.request.form_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: {foo: 'bar'},
container: "#main"
})
})
asyncTest("GET with data array"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo%5B%5D=bar&foo%5B%5D=baz")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
var expected = {'foo': ['bar', 'baz']}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.query_hash'], expected)
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: [{name: "foo[]", value: "bar"}, {name: "foo[]", value: "baz"}],
container: "#main"
})
})
asyncTest("POST with data array"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
var expected = {'foo': ['bar', 'baz']}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.form_hash'], expected)
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: [{name: "foo[]", value: "bar"}, {name: "foo[]", value: "baz"}],
container: "#main"
})
})
asyncTest("GET with data string"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=bar")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
equal(env['rack.request.query_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: "foo=bar",
container: "#main"
})
})
asyncTest("POST with data string"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
equal(env['rack.request.form_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: "foo=bar",
container: "#main"
})
})
asyncTest("handle form submit"+s, function() {
var frame = this.frame
frame.$(frame.document).on("submit", "form", function(event) {
frame.$.pjax.submit(event, "#main")
})
this.loaded = function() {
var env = JSON.parse(frame.$("#env").text())
var expected = {foo: "1", bar: "2"}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.query_hash'], expected)
start()
}
frame.$("form").submit()
})
asyncTest("browser URL is correct after redirect"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
var expectedHash = safari && disabled ? "" : "#new"
equal(frame.location.hash, expectedHash)
start()
}
frame.$.pjax({
url: "redirect.html#new",
container: "#main"
})
})
asyncTest("server can't affect anchor after redirect"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
var expectedHash = safari && disabled ? "" : "#new"
equal(frame.location.hash, expectedHash)
start()
}
frame.$.pjax({
url: "redirect.html?anchor=server#new",
container: "#main"
})
})
})

View File

@@ -0,0 +1,11 @@
<%= title 'aliens' %>
<ul>
<li><a href="/home.html">home</a></li>
<li><a href="/dinosaurs.html">dinosaurs</a></li>
<li>aliens</li>
</ul>
<img src="/img/aliens.jpg" title="aliens">
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,4 @@
<%= title 'Anchor' %>
<div id="top" style="width:500px;height:10000px;"></div>
<a name="bottom" style="width:500px;height:10000px;display:block;"></a>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1 @@
<p>500</p>

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>500 sans pjax</title>
</head>
<body>
<div id="main">
<p>500 sans pjax</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<%= title 'dinosaurs' %>
<ul>
<li><a href="/home.html">home</a></li>
<li>dinosaurs</li>
<li><a href="/aliens.html">aliens</a></li>
</ul>
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/GcjxwXCxBBU" frameborder="0" allowfullscreen></iframe>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,3 @@
<%= title 'Hello' %>
<p><title>World!</title> Hello!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

View File

@@ -0,0 +1,2 @@
<div id="env"><%= Rack::Utils.escape_html JSON.generate(request.env) %></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,7 @@
<div id="foo" title="Foo">
<p>Foo</p>
</div>
<div id="bar" data-title="Bar">
<p>Bar</p>
</div>

View File

@@ -0,0 +1,4 @@
<%= title 'Hello' %>
<p>Hello!</p>
How's it going?
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,19 @@
<%= title 'Home' %>
<ul>
<li>home</li>
<li><a href="/dinosaurs.html">dinosaurs</a></li>
<li><a href="/aliens.html">aliens</a></li>
<li><a href="https://www.google.com/">Google</a></li>
<li><a href="#main">Main</a></li>
<li><a href="#">Empty</a></li>
</ul>
<form action="env.html" method="GET">
<input name="foo" value="1">
<input name="bar" value="2">
</form>
<div style="width:500px;height:10000px;"></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= @title %></title>
<script type="text/javascript" src="/vendor/jquery-<%= jquery_version %>.js"></script>
<script type="text/javascript" src="/jquery.pjax.js"></script>
</head>
<body>
<div id="main">
<%= yield %>
</div>
</body>
</html>

View File

@@ -0,0 +1,4 @@
<%= title 'Long' %>
<p>Long Page</p>
<div style="width:500px;height:10000px;"></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,2 @@
<p><%= title 'Hello' %> Hello!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/vendor/qunit.css">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<script type="text/javascript" src="/vendor/jquery-<%= jquery_version %>.js"></script>
<script type="text/javascript" src="/vendor/qunit.js"></script>
<script type="text/javascript">QUnit.config.testTimeout = 2000</script>
<script type="text/javascript" src="/jquery.pjax.js"></script>
<script type="text/javascript" src="/test/unit/helpers.js"></script>
<script type="text/javascript" src="/test/unit/pjax.js"></script>
<script type="text/javascript" src="/test/unit/fn_pjax.js"></script>
<script type="text/javascript" src="/test/unit/pjax_fallback.js"></script>
</head>
<body>
<div id="qunit"></div>
<ol id="qunit-fixture"></ol>
</body>
</html>

View File

@@ -0,0 +1,2 @@
<p id="referer"><%= request.referer %></p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,8 @@
<p>Got some script tags here</p>
<script type="text/javascript" src="/test/evaled.js?1"></script>
<script src="/test/evaled.js?2"></script>
<script type="text/javascript">
window.evaledInlineLog = window.evaledInlineLog || []
window.evaledInlineLog.push('<%= params[:name] %>')
</script>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,5 @@
<%= title 'Timeout!' %>
<p>SLOW DOWN!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>