Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
3f515045
Commit
3f515045
authored
Nov 01, 2012
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket: remove test suite external dependencies
parent
395f1da7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
37 deletions
+38
-37
.jshintrc
test/.jshintrc
+2
-1
iframe-denied.html
test/data/manipulation/iframe-denied.html
+2
-2
testElementCrash.html
test/data/support/testElementCrash.html
+1
-1
testinit.js
test/data/testinit.js
+17
-18
with_fries.xml
test/data/with_fries.xml
+3
-3
ajax.js
test/unit/ajax.js
+4
-3
attributes.js
test/unit/attributes.js
+1
-1
core.js
test/unit/core.js
+7
-7
css.js
test/unit/css.js
+1
-1
No files found.
test/.jshintrc
View file @
3f515045
...
...
@@ -54,6 +54,7 @@
"isLocal": true,
"originaljQuery": true,
"$": true,
"original$": true
"original$": true,
"externalHost": true,
}
}
test/data/manipulation/iframe-denied.html
View file @
3f515045
...
...
@@ -10,7 +10,7 @@
<script>
var
script
=
document
.
getElementsByTagName
(
"script"
)[
0
],
div
=
document
.
createElement
(
"div"
),
src
=
"http://
google.com"
,
src
=
"http://
"
+
window
.
parent
.
externalHost
,
success
=
true
,
error
=
""
;
...
...
@@ -31,6 +31,6 @@
(
error
?
": "
+
error
:
""
)
});
});
</script>
</script>
</body>
</html>
test/data/support/testElementCrash.html
View file @
3f515045
...
...
@@ -4,7 +4,7 @@
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<style>
body
{
background
:
url('
http://s1.postimage.org/2d2r8xih0/body_background.pn
g')
;
background
:
url('
../1x1.jp
g')
;
}
</style>
<script
src=
"../../../dist/jquery.js"
></script>
...
...
test/data/testinit.js
View file @
3f515045
/*jshint multistr:true */
var
originaljQuery
=
this
.
jQuery
||
"jQuery"
,
var
amdDefined
,
fireNative
,
originaljQuery
=
this
.
jQuery
||
"jQuery"
,
original$
=
this
.
$
||
"$"
,
hasPHP
=
true
,
// Disable Ajax tests to reduce network strain
// Re-enabled (at least the variable should be declared)
isLocal
=
window
.
location
.
protocol
===
"file:"
,
amdDefined
;
// see RFC 2606
externalHost
=
"example.com"
;
// For testing .noConflict()
this
.
jQuery
=
originaljQuery
;
...
...
@@ -58,7 +58,7 @@ function t( a, b, c ) {
deepEqual
(
f
,
q
.
apply
(
q
,
c
),
a
+
" ("
+
b
+
")"
);
}
var
createDashboardXML
=
function
()
{
function
createDashboardXML
()
{
var
string
=
'<?xml version="1.0" encoding="UTF-8"?>
\
<dashboard>
\
<locations class="foo">
\
...
...
@@ -74,17 +74,17 @@ var createDashboardXML = function() {
return
jQuery
.
parseXML
(
string
);
};
var
createWithFriesXML
=
function
()
{
function
createWithFriesXML
()
{
var
string
=
'<?xml version="1.0" encoding="UTF-8"?>
\
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
\
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
\
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
\
<soap:Body>
\
<jsconf xmlns="http://
www.example.com
/ns1">
\
<response xmlns:ab="http://
www.example.com
/ns2">
\
<jsconf xmlns="http://
{{ externalHost }}
/ns1">
\
<response xmlns:ab="http://
{{ externalHost }}
/ns2">
\
<meta>
\
<component id="seite1" class="component">
\
<properties xmlns:cd="http://
www.example.com
/ns3">
\
<properties xmlns:cd="http://
{{ externalHost }}
/ns3">
\
<property name="prop1">
\
<thing />
\
<value>1</value>
\
...
...
@@ -101,10 +101,10 @@ var createWithFriesXML = function() {
</soap:Body>
\
</soap:Envelope>'
;
return
jQuery
.
parseXML
(
string
);
return
jQuery
.
parseXML
(
string
.
replace
(
/
\{\{\s
*externalHost
\s
*
\}\}
/g
,
externalHost
)
);
};
var
createXMLFragment
=
function
()
{
function
createXMLFragment
()
{
var
xml
,
frag
;
if
(
window
.
ActiveXObject
)
{
xml
=
new
ActiveXObject
(
"msxml2.domdocument"
);
...
...
@@ -119,19 +119,16 @@ var createXMLFragment = function() {
return
frag
;
};
var
fireNative
;
if
(
document
.
createEvent
)
{
fireNative
=
function
(
node
,
type
)
{
fireNative
=
document
.
createEvent
?
function
(
node
,
type
)
{
var
event
=
document
.
createEvent
(
'HTMLEvents'
);
event
.
initEvent
(
type
,
true
,
true
);
node
.
dispatchEvent
(
event
);
};
}
else
{
fireNative
=
function
(
node
,
type
)
{
}
:
function
(
node
,
type
)
{
var
event
=
document
.
createEventObject
();
node
.
fireEvent
(
'on'
+
type
,
event
);
};
}
/**
* Add random number to url to stop caching
...
...
@@ -201,6 +198,8 @@ function url( value ) {
).
appendTo
(
"body"
);
});
};
window
.
iframeCallback
=
undefined
;
}());
// Sandbox start for great justice
...
...
test/data/with_fries.xml
View file @
3f515045
...
...
@@ -3,11 +3,11 @@
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<soap:Body>
<jsconf
xmlns=
"http://
www.
example.com/ns1"
>
<response
xmlns:ab=
"http://
www.
example.com/ns2"
>
<jsconf
xmlns=
"http://example.com/ns1"
>
<response
xmlns:ab=
"http://example.com/ns2"
>
<meta>
<component
id=
"seite1"
class=
"component"
>
<properties
xmlns:cd=
"http://
www.
example.com/ns3"
>
<properties
xmlns:cd=
"http://example.com/ns3"
>
<property
name=
"prop1"
>
<thing
/>
<value>
1
</value>
...
...
test/unit/ajax.js
View file @
3f515045
...
...
@@ -621,7 +621,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
jQuery
.
ajax
({
dataType
:
"jsonp"
,
url
:
loc
.
protocol
+
"//
somewebsitethatdoesnotexist-656329477541.com
:"
+
(
loc
.
port
||
80
),
url
:
loc
.
protocol
+
"//
example.invalid
:"
+
(
loc
.
port
||
80
),
beforeSend
:
function
(
_
,
s
)
{
ok
(
s
.
crossDomain
,
"Test different hostnames are detected as cross-domain"
);
return
false
;
...
...
@@ -2377,7 +2377,8 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
var
i
=
1
;
jQuery
.
ajax
({
url
:
"http://somewebsitethatdoesnotexist-67864863574657654.com"
,
// see RFC 2606
url
:
"http://example.invalid"
,
success
:
function
()
{
ok
(
false
,
"success"
);
},
...
...
@@ -2398,7 +2399,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
var
i
=
1
;
jQuery
.
ajax
({
url
:
"http://
www.google.com"
,
url
:
"http://
"
+
externalHost
,
success
:
function
()
{
ok
(
false
,
"success"
);
},
...
...
test/unit/attributes.js
View file @
3f515045
...
...
@@ -119,7 +119,7 @@ test( "attr(String)", function() {
equal
(
jQuery
(
option
).
attr
(
"selected"
),
"selected"
,
"Make sure that a single option is selected, even when in an optgroup."
);
var
$img
=
jQuery
(
"<img style='display:none' width='215' height='53' src='
http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif
'/>"
).
appendTo
(
"body"
);
var
$img
=
jQuery
(
"<img style='display:none' width='215' height='53' src='
data/1x1.jpg
'/>"
).
appendTo
(
"body"
);
equal
(
$img
.
attr
(
"width"
),
"215"
,
"Retrieve width attribute an an element with display:none."
);
equal
(
$img
.
attr
(
"height"
),
"53"
,
"Retrieve height attribute an an element with display:none."
);
...
...
test/unit/core.js
View file @
3f515045
...
...
@@ -218,16 +218,16 @@ test("noConflict", function() {
var
$$
=
jQuery
;
e
qual
(
jQuery
,
jQuery
.
noConflict
(),
"noConflict returned the jQuery object"
);
e
qual
(
window
[
"jQuery"
],
$$
,
"Make sure jQuery wasn't touched."
);
e
qual
(
window
[
"$"
],
original$
,
"Make sure $ was reverted."
);
strictE
qual
(
jQuery
,
jQuery
.
noConflict
(),
"noConflict returned the jQuery object"
);
strictE
qual
(
window
[
"jQuery"
],
$$
,
"Make sure jQuery wasn't touched."
);
strictE
qual
(
window
[
"$"
],
original$
,
"Make sure $ was reverted."
);
jQuery
=
$
=
$$
;
e
qual
(
jQuery
.
noConflict
(
true
),
$$
,
"noConflict returned the jQuery object"
);
e
qual
(
window
[
"jQuery"
],
originaljQuery
,
"Make sure jQuery was reverted."
);
e
qual
(
window
[
"$"
],
original$
,
"Make sure $ was reverted."
);
ok
(
$$
(
"#qunit-fixture"
).
html
(
"test"
),
"Make sure that jQuery still works."
);
strictE
qual
(
jQuery
.
noConflict
(
true
),
$$
,
"noConflict returned the jQuery object"
);
strictE
qual
(
window
[
"jQuery"
],
originaljQuery
,
"Make sure jQuery was reverted."
);
strictE
qual
(
window
[
"$"
],
original$
,
"Make sure $ was reverted."
);
ok
(
$$
(
).
pushStack
([]
),
"Make sure that jQuery still works."
);
window
[
"jQuery"
]
=
jQuery
=
$$
;
});
...
...
test/unit/css.js
View file @
3f515045
...
...
@@ -746,7 +746,7 @@ test("widows & orphans #8936", function () {
test
(
"can't get css for disconnected in IE<9, see #10254 and #8388"
,
function
()
{
expect
(
2
);
var
span
=
jQuery
(
"<span/>"
).
css
(
"background-image"
,
"url(
http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif
)"
);
var
span
=
jQuery
(
"<span/>"
).
css
(
"background-image"
,
"url(
data/1x1.jpg
)"
);
notEqual
(
span
.
css
(
"background-image"
),
null
,
"can't get background-image in IE<9, see #10254"
);
var
div
=
jQuery
(
"<div/>"
).
css
(
"top"
,
10
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment