mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Build: Move all external libraries to external directory
Closes gh-1593 Conflicts: Gruntfile.js test/index.html
This commit is contained in:
committed by
Timmy Willison
parent
62f7f7be9b
commit
72e6192517
@@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<title>jQuery Test Suite</title>
|
||||
<link rel="Stylesheet" media="screen" href="libs/qunit/qunit.css" />
|
||||
<link rel="Stylesheet" media="screen" href="../external/qunit/qunit.css" />
|
||||
<link rel="Stylesheet" media="screen" href="data/testsuite.css" />
|
||||
<!-- Includes -->
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
-->
|
||||
<script src="data/jquery-1.9.1.js"></script>
|
||||
|
||||
<script src="libs/qunit/qunit.js"></script>
|
||||
<script src="libs/require.js"></script>
|
||||
<script src="libs/sinon/fake_timers.js"></script>
|
||||
<script src="libs/sinon/timers_ie.js"></script>
|
||||
<script src="../external/qunit/qunit.js"></script>
|
||||
<script src="../external/requirejs/require.js"></script>
|
||||
<script src="../external/sinon/fake_timers.js"></script>
|
||||
<script src="../external/sinon/timers_ie.js"></script>
|
||||
<!-- See testinit for the list of tests -->
|
||||
<script src="data/testinit.js"></script>
|
||||
|
||||
|
||||
2
test/jquery.js
vendored
2
test/jquery.js
vendored
@@ -32,7 +32,7 @@
|
||||
require.config({
|
||||
baseUrl: path,
|
||||
paths: {
|
||||
sizzle: "src/sizzle/dist/sizzle"
|
||||
sizzle: "external/sizzle/dist/sizzle"
|
||||
}
|
||||
});
|
||||
src = "src/jquery";
|
||||
|
||||
@@ -1,237 +0,0 @@
|
||||
/*!
|
||||
* QUnit 1.14.0
|
||||
* http://qunitjs.com/
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2014-01-31T16:40Z
|
||||
*/
|
||||
|
||||
/** Font Family and Sizes */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
|
||||
#qunit-tests { font-size: smaller; }
|
||||
|
||||
|
||||
/** Resets */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/** Header */
|
||||
|
||||
#qunit-header {
|
||||
padding: 0.5em 0 0.5em 1em;
|
||||
|
||||
color: #8699A4;
|
||||
background-color: #0D3349;
|
||||
|
||||
font-size: 1.5em;
|
||||
line-height: 1em;
|
||||
font-weight: 400;
|
||||
|
||||
border-radius: 5px 5px 0 0;
|
||||
}
|
||||
|
||||
#qunit-header a {
|
||||
text-decoration: none;
|
||||
color: #C2CCD1;
|
||||
}
|
||||
|
||||
#qunit-header a:hover,
|
||||
#qunit-header a:focus {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar label {
|
||||
display: inline-block;
|
||||
padding: 0 0.5em 0 0.1em;
|
||||
}
|
||||
|
||||
#qunit-banner {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar {
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
color: #5E740B;
|
||||
background-color: #EEE;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#qunit-userAgent {
|
||||
padding: 0.5em 0 0.5em 2.5em;
|
||||
background-color: #2B81AF;
|
||||
color: #FFF;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||
}
|
||||
|
||||
#qunit-modulefilter-container {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/** Tests: Pass/Fail */
|
||||
|
||||
#qunit-tests {
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests li {
|
||||
padding: 0.4em 0.5em 0.4em 2.5em;
|
||||
border-bottom: 1px solid #FFF;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests li strong {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#qunit-tests li a {
|
||||
padding: 0.5em;
|
||||
color: #C2CCD1;
|
||||
text-decoration: none;
|
||||
}
|
||||
#qunit-tests li a:hover,
|
||||
#qunit-tests li a:focus {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#qunit-tests li .runtime {
|
||||
float: right;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.qunit-assert-list {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
|
||||
background-color: #FFF;
|
||||
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.qunit-collapsed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
#qunit-tests th {
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
padding: 0 0.5em 0 0;
|
||||
}
|
||||
|
||||
#qunit-tests td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#qunit-tests pre {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#qunit-tests del {
|
||||
background-color: #E0F2BE;
|
||||
color: #374E0C;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#qunit-tests ins {
|
||||
background-color: #FFCACA;
|
||||
color: #500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/*** Test Counts */
|
||||
|
||||
#qunit-tests b.counts { color: #000; }
|
||||
#qunit-tests b.passed { color: #5E740B; }
|
||||
#qunit-tests b.failed { color: #710909; }
|
||||
|
||||
#qunit-tests li li {
|
||||
padding: 5px;
|
||||
background-color: #FFF;
|
||||
border-bottom: none;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/*** Passing Styles */
|
||||
|
||||
#qunit-tests li li.pass {
|
||||
color: #3C510C;
|
||||
background-color: #FFF;
|
||||
border-left: 10px solid #C6E746;
|
||||
}
|
||||
|
||||
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
|
||||
#qunit-tests .pass .test-name { color: #366097; }
|
||||
|
||||
#qunit-tests .pass .test-actual,
|
||||
#qunit-tests .pass .test-expected { color: #999; }
|
||||
|
||||
#qunit-banner.qunit-pass { background-color: #C6E746; }
|
||||
|
||||
/*** Failing Styles */
|
||||
|
||||
#qunit-tests li li.fail {
|
||||
color: #710909;
|
||||
background-color: #FFF;
|
||||
border-left: 10px solid #EE5757;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
#qunit-tests > li:last-child {
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
#qunit-tests .fail { color: #000; background-color: #EE5757; }
|
||||
#qunit-tests .fail .test-name,
|
||||
#qunit-tests .fail .module-name { color: #000; }
|
||||
|
||||
#qunit-tests .fail .test-actual { color: #EE5757; }
|
||||
#qunit-tests .fail .test-expected { color: #008000; }
|
||||
|
||||
#qunit-banner.qunit-fail { background-color: #EE5757; }
|
||||
|
||||
|
||||
/** Result */
|
||||
|
||||
#qunit-testresult {
|
||||
padding: 0.5em 0.5em 0.5em 2.5em;
|
||||
|
||||
color: #2B81AF;
|
||||
background-color: #D2E0E6;
|
||||
|
||||
border-bottom: 1px solid #FFF;
|
||||
}
|
||||
#qunit-testresult .module-name {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/** Fixture */
|
||||
|
||||
#qunit-fixture {
|
||||
position: absolute;
|
||||
top: -10000px;
|
||||
left: -10000px;
|
||||
width: 1000px;
|
||||
height: 1000px;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
2068
test/libs/require.js
2068
test/libs/require.js
File diff suppressed because it is too large
Load Diff
@@ -1,385 +0,0 @@
|
||||
/*jslint eqeqeq: false, plusplus: false, evil: true, onevar: false, browser: true, forin: false*/
|
||||
/*global module, require, window*/
|
||||
/**
|
||||
* Fake timer API
|
||||
* setTimeout
|
||||
* setInterval
|
||||
* clearTimeout
|
||||
* clearInterval
|
||||
* tick
|
||||
* reset
|
||||
* Date
|
||||
*
|
||||
* Inspired by jsUnitMockTimeOut from JsUnit
|
||||
*
|
||||
* @author Christian Johansen (christian@cjohansen.no)
|
||||
* @license BSD
|
||||
*
|
||||
* Copyright (c) 2010-2013 Christian Johansen
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
if (typeof sinon == "undefined") {
|
||||
var sinon = {};
|
||||
}
|
||||
|
||||
(function (global) {
|
||||
var id = 1;
|
||||
|
||||
function addTimer(args, recurring) {
|
||||
if (args.length === 0) {
|
||||
throw new Error("Function requires at least 1 parameter");
|
||||
}
|
||||
|
||||
if (typeof args[0] === "undefined") {
|
||||
throw new Error("Callback must be provided to timer calls");
|
||||
}
|
||||
|
||||
var toId = id++;
|
||||
var delay = args[1] || 0;
|
||||
|
||||
if (!this.timeouts) {
|
||||
this.timeouts = {};
|
||||
}
|
||||
|
||||
this.timeouts[toId] = {
|
||||
id: toId,
|
||||
func: args[0],
|
||||
callAt: this.now + delay,
|
||||
invokeArgs: Array.prototype.slice.call(args, 2)
|
||||
};
|
||||
|
||||
if (recurring === true) {
|
||||
this.timeouts[toId].interval = delay;
|
||||
}
|
||||
|
||||
return toId;
|
||||
}
|
||||
|
||||
function parseTime(str) {
|
||||
if (!str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var strings = str.split(":");
|
||||
var l = strings.length, i = l;
|
||||
var ms = 0, parsed;
|
||||
|
||||
if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
|
||||
throw new Error("tick only understands numbers and 'h:m:s'");
|
||||
}
|
||||
|
||||
while (i--) {
|
||||
parsed = parseInt(strings[i], 10);
|
||||
|
||||
if (parsed >= 60) {
|
||||
throw new Error("Invalid time " + str);
|
||||
}
|
||||
|
||||
ms += parsed * Math.pow(60, (l - i - 1));
|
||||
}
|
||||
|
||||
return ms * 1000;
|
||||
}
|
||||
|
||||
function createObject(object) {
|
||||
var newObject;
|
||||
|
||||
if (Object.create) {
|
||||
newObject = Object.create(object);
|
||||
} else {
|
||||
var F = function () {};
|
||||
F.prototype = object;
|
||||
newObject = new F();
|
||||
}
|
||||
|
||||
newObject.Date.clock = newObject;
|
||||
return newObject;
|
||||
}
|
||||
|
||||
sinon.clock = {
|
||||
now: 0,
|
||||
|
||||
create: function create(now) {
|
||||
var clock = createObject(this);
|
||||
|
||||
if (typeof now == "number") {
|
||||
clock.now = now;
|
||||
}
|
||||
|
||||
if (!!now && typeof now == "object") {
|
||||
throw new TypeError("now should be milliseconds since UNIX epoch");
|
||||
}
|
||||
|
||||
return clock;
|
||||
},
|
||||
|
||||
setTimeout: function setTimeout(callback, timeout) {
|
||||
return addTimer.call(this, arguments, false);
|
||||
},
|
||||
|
||||
clearTimeout: function clearTimeout(timerId) {
|
||||
if (!this.timeouts) {
|
||||
this.timeouts = [];
|
||||
}
|
||||
|
||||
if (timerId in this.timeouts) {
|
||||
delete this.timeouts[timerId];
|
||||
}
|
||||
},
|
||||
|
||||
setInterval: function setInterval(callback, timeout) {
|
||||
return addTimer.call(this, arguments, true);
|
||||
},
|
||||
|
||||
clearInterval: function clearInterval(timerId) {
|
||||
this.clearTimeout(timerId);
|
||||
},
|
||||
|
||||
setImmediate: function setImmediate(callback) {
|
||||
var passThruArgs = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
return addTimer.call(this, [callback, 0].concat(passThruArgs), false);
|
||||
},
|
||||
|
||||
clearImmediate: function clearImmediate(timerId) {
|
||||
this.clearTimeout(timerId);
|
||||
},
|
||||
|
||||
tick: function tick(ms) {
|
||||
ms = typeof ms == "number" ? ms : parseTime(ms);
|
||||
var tickFrom = this.now, tickTo = this.now + ms, previous = this.now;
|
||||
var timer = this.firstTimerInRange(tickFrom, tickTo);
|
||||
|
||||
var firstException;
|
||||
while (timer && tickFrom <= tickTo) {
|
||||
if (this.timeouts[timer.id]) {
|
||||
tickFrom = this.now = timer.callAt;
|
||||
try {
|
||||
this.callTimer(timer);
|
||||
} catch (e) {
|
||||
firstException = firstException || e;
|
||||
}
|
||||
}
|
||||
|
||||
timer = this.firstTimerInRange(previous, tickTo);
|
||||
previous = tickFrom;
|
||||
}
|
||||
|
||||
this.now = tickTo;
|
||||
|
||||
if (firstException) {
|
||||
throw firstException;
|
||||
}
|
||||
|
||||
return this.now;
|
||||
},
|
||||
|
||||
firstTimerInRange: function (from, to) {
|
||||
var timer, smallest = null, originalTimer;
|
||||
|
||||
for (var id in this.timeouts) {
|
||||
if (this.timeouts.hasOwnProperty(id)) {
|
||||
if (this.timeouts[id].callAt < from || this.timeouts[id].callAt > to) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (smallest === null || this.timeouts[id].callAt < smallest) {
|
||||
originalTimer = this.timeouts[id];
|
||||
smallest = this.timeouts[id].callAt;
|
||||
|
||||
timer = {
|
||||
func: this.timeouts[id].func,
|
||||
callAt: this.timeouts[id].callAt,
|
||||
interval: this.timeouts[id].interval,
|
||||
id: this.timeouts[id].id,
|
||||
invokeArgs: this.timeouts[id].invokeArgs
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return timer || null;
|
||||
},
|
||||
|
||||
callTimer: function (timer) {
|
||||
if (typeof timer.interval == "number") {
|
||||
this.timeouts[timer.id].callAt += timer.interval;
|
||||
} else {
|
||||
delete this.timeouts[timer.id];
|
||||
}
|
||||
|
||||
try {
|
||||
if (typeof timer.func == "function") {
|
||||
timer.func.apply(null, timer.invokeArgs);
|
||||
} else {
|
||||
eval(timer.func);
|
||||
}
|
||||
} catch (e) {
|
||||
var exception = e;
|
||||
}
|
||||
|
||||
if (!this.timeouts[timer.id]) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
},
|
||||
|
||||
reset: function reset() {
|
||||
this.timeouts = {};
|
||||
},
|
||||
|
||||
Date: (function () {
|
||||
var NativeDate = Date;
|
||||
|
||||
function ClockDate(year, month, date, hour, minute, second, ms) {
|
||||
// Defensive and verbose to avoid potential harm in passing
|
||||
// explicit undefined when user does not pass argument
|
||||
switch (arguments.length) {
|
||||
case 0:
|
||||
return new NativeDate(ClockDate.clock.now);
|
||||
case 1:
|
||||
return new NativeDate(year);
|
||||
case 2:
|
||||
return new NativeDate(year, month);
|
||||
case 3:
|
||||
return new NativeDate(year, month, date);
|
||||
case 4:
|
||||
return new NativeDate(year, month, date, hour);
|
||||
case 5:
|
||||
return new NativeDate(year, month, date, hour, minute);
|
||||
case 6:
|
||||
return new NativeDate(year, month, date, hour, minute, second);
|
||||
default:
|
||||
return new NativeDate(year, month, date, hour, minute, second, ms);
|
||||
}
|
||||
}
|
||||
|
||||
return mirrorDateProperties(ClockDate, NativeDate);
|
||||
}())
|
||||
};
|
||||
|
||||
function mirrorDateProperties(target, source) {
|
||||
if (source.now) {
|
||||
target.now = function now() {
|
||||
return target.clock.now;
|
||||
};
|
||||
} else {
|
||||
delete target.now;
|
||||
}
|
||||
|
||||
if (source.toSource) {
|
||||
target.toSource = function toSource() {
|
||||
return source.toSource();
|
||||
};
|
||||
} else {
|
||||
delete target.toSource;
|
||||
}
|
||||
|
||||
target.toString = function toString() {
|
||||
return source.toString();
|
||||
};
|
||||
|
||||
target.prototype = source.prototype;
|
||||
target.parse = source.parse;
|
||||
target.UTC = source.UTC;
|
||||
target.prototype.toUTCString = source.prototype.toUTCString;
|
||||
|
||||
for (var prop in source) {
|
||||
if (source.hasOwnProperty(prop)) {
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
var methods = ["Date", "setTimeout", "setInterval",
|
||||
"clearTimeout", "clearInterval"];
|
||||
|
||||
if (typeof global.setImmediate !== "undefined") {
|
||||
methods.push("setImmediate");
|
||||
}
|
||||
|
||||
if (typeof global.clearImmediate !== "undefined") {
|
||||
methods.push("clearImmediate");
|
||||
}
|
||||
|
||||
function restore() {
|
||||
var method;
|
||||
|
||||
for (var i = 0, l = this.methods.length; i < l; i++) {
|
||||
method = this.methods[i];
|
||||
|
||||
if (global[method].hadOwnProperty) {
|
||||
global[method] = this["_" + method];
|
||||
} else {
|
||||
try {
|
||||
delete global[method];
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent multiple executions which will completely remove these props
|
||||
this.methods = [];
|
||||
}
|
||||
|
||||
function stubGlobal(method, clock) {
|
||||
clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(global, method);
|
||||
clock["_" + method] = global[method];
|
||||
|
||||
if (method == "Date") {
|
||||
var date = mirrorDateProperties(clock[method], global[method]);
|
||||
global[method] = date;
|
||||
} else {
|
||||
global[method] = function () {
|
||||
return clock[method].apply(clock, arguments);
|
||||
};
|
||||
|
||||
for (var prop in clock[method]) {
|
||||
if (clock[method].hasOwnProperty(prop)) {
|
||||
global[method][prop] = clock[method][prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
global[method].clock = clock;
|
||||
}
|
||||
|
||||
sinon.useFakeTimers = function useFakeTimers(now) {
|
||||
var clock = sinon.clock.create(now);
|
||||
clock.restore = restore;
|
||||
clock.methods = Array.prototype.slice.call(arguments,
|
||||
typeof now == "number" ? 1 : 0);
|
||||
|
||||
if (clock.methods.length === 0) {
|
||||
clock.methods = methods;
|
||||
}
|
||||
|
||||
for (var i = 0, l = clock.methods.length; i < l; i++) {
|
||||
stubGlobal(clock.methods[i], clock);
|
||||
}
|
||||
|
||||
return clock;
|
||||
};
|
||||
}(typeof global != "undefined" && typeof global !== "function" ? global : this));
|
||||
|
||||
sinon.timers = {
|
||||
setTimeout: setTimeout,
|
||||
clearTimeout: clearTimeout,
|
||||
setImmediate: (typeof setImmediate !== "undefined" ? setImmediate : undefined),
|
||||
clearImmediate: (typeof clearImmediate !== "undefined" ? clearImmediate: undefined),
|
||||
setInterval: setInterval,
|
||||
clearInterval: clearInterval,
|
||||
Date: Date
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = sinon;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*global sinon, setTimeout, setInterval, clearTimeout, clearInterval, Date*/
|
||||
/**
|
||||
* Helps IE run the fake timers. By defining global functions, IE allows
|
||||
* them to be overwritten at a later point. If these are not defined like
|
||||
* this, overwriting them will result in anything from an exception to browser
|
||||
* crash.
|
||||
*
|
||||
* If you don't require fake timers to work in IE, don't include this file.
|
||||
*
|
||||
* @author Christian Johansen (christian@cjohansen.no)
|
||||
* @license BSD
|
||||
*
|
||||
* Copyright (c) 2010-2013 Christian Johansen
|
||||
*/
|
||||
function setTimeout() {}
|
||||
function clearTimeout() {}
|
||||
function setImmediate() {}
|
||||
function clearImmediate() {}
|
||||
function setInterval() {}
|
||||
function clearInterval() {}
|
||||
function Date() {}
|
||||
|
||||
// Reassign the original functions. Now their writable attribute
|
||||
// should be true. Hackish, I know, but it works.
|
||||
setTimeout = sinon.timers.setTimeout;
|
||||
clearTimeout = sinon.timers.clearTimeout;
|
||||
setImmediate = sinon.timers.setImmediate;
|
||||
clearImmediate = sinon.timers.clearImmediate;
|
||||
setInterval = sinon.timers.setInterval;
|
||||
clearInterval = sinon.timers.clearInterval;
|
||||
Date = sinon.timers.Date;
|
||||
Reference in New Issue
Block a user