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
54035207
Commit
54035207
authored
Jul 09, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaked some of the tests, added in events and fx tests.
parent
b09043fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
13 deletions
+34
-13
test.js
build/runtest/test.js
+6
-1
testrunner.js
build/runtest/testrunner.js
+22
-1
eventTest.js
src/event/eventTest.js
+5
-10
coreTest.js
src/jquery/coreTest.js
+1
-1
No files found.
build/runtest/test.js
View file @
54035207
...
@@ -6,7 +6,12 @@ window.location = "test/index.html";
...
@@ -6,7 +6,12 @@ window.location = "test/index.html";
load
(
"dist/jquery.js"
,
"build/runtest/testrunner.js"
);
load
(
"dist/jquery.js"
,
"build/runtest/testrunner.js"
);
// Load the tests
// Load the tests
load
(
"src/jquery/coreTest.js"
,
"src/selector/selectorTest.js"
);
load
(
"src/jquery/coreTest.js"
,
"src/selector/selectorTest.js"
,
"src/event/eventTest.js"
,
"src/fx/fxTest.js"
);
// Display the results
// Display the results
results
();
results
();
build/runtest/testrunner.js
View file @
54035207
...
@@ -160,4 +160,25 @@ function results(){
...
@@ -160,4 +160,25 @@ function results(){
}
}
function
start
(){}
function
start
(){}
function
stop
(){}
function
stop
(){}
\ No newline at end of file
/**
* Trigger an event on an element.
*
* @example triggerEvent( document.body, "click" );
*
* @param DOMElement elem
* @param String type
*/
function
triggerEvent
(
elem
,
type
,
event
)
{
/*
if ( jQuery.browser.mozilla || jQuery.browser.opera ) {
event = document.createEvent("MouseEvents");
event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem.dispatchEvent( event );
} else if ( jQuery.browser.msie ) {
elem.fireEvent("on"+type);
}
*/
}
\ No newline at end of file
src/event/eventTest.js
View file @
54035207
...
@@ -28,22 +28,17 @@ test("bind()", function() {
...
@@ -28,22 +28,17 @@ test("bind()", function() {
// events don't work with iframes, see #939
// events don't work with iframes, see #939
var
tmp
=
document
.
createElement
(
'iframe'
);
var
doc
=
document
.
getElementById
(
"iframe"
).
contentDocument
;
document
.
body
.
appendChild
(
tmp
);
var
doc
=
tmp
.
contentWindow
.
document
;
doc
.
body
.
innerHTML
=
"<input type='text'/>"
;
doc
.
open
();
doc
.
write
(
"<html><body><input type='text'/></body></html>"
);
doc
.
close
();
var
input
=
doc
.
getElementsByTagName
(
"input"
)[
0
];
var
input
=
doc
.
getElementsByTagName
(
"input"
)[
0
];
$
(
input
).
bind
(
"click"
,
function
()
{
$
(
input
).
bind
(
"click"
,
function
()
{
ok
(
true
,
"Binding to element inside iframe"
);
ok
(
true
,
"Binding to element inside iframe"
);
});
}).
click
();
triggerEvent
(
input
,
"click"
);
document
.
body
.
removeChild
(
tmp
);
//triggerEvent( input, "click"
);
var
counter
=
0
;
var
counter
=
0
;
function
selectOnChange
(
event
)
{
function
selectOnChange
(
event
)
{
...
...
src/jquery/coreTest.js
View file @
54035207
...
@@ -340,7 +340,7 @@ test("wrap(String|Element)", function() {
...
@@ -340,7 +340,7 @@ test("wrap(String|Element)", function() {
ok
(
result
.
text
()
==
defaultText
,
'Check for element wrapping'
);
ok
(
result
.
text
()
==
defaultText
,
'Check for element wrapping'
);
reset
();
reset
();
stop
();
//
stop();
$
(
'#check1'
).
click
(
function
()
{
$
(
'#check1'
).
click
(
function
()
{
var
checkbox
=
this
;
var
checkbox
=
this
;
ok
(
checkbox
.
checked
,
"Checkbox's state is erased after wrap() action, see #769"
);
ok
(
checkbox
.
checked
,
"Checkbox's state is erased after wrap() action, see #769"
);
...
...
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