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
8a356f0d
Commit
8a356f0d
authored
Jan 14, 2008
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding browser UA tests
parent
709df933
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
core.js
test/unit/core.js
+36
-0
No files found.
test/unit/core.js
View file @
8a356f0d
...
@@ -43,6 +43,42 @@ test("$()", function() {
...
@@ -43,6 +43,42 @@ test("$()", function() {
equals
(
div
.
length
,
4
,
"Correct number of elements generated for div hr code b"
);
equals
(
div
.
length
,
4
,
"Correct number of elements generated for div hr code b"
);
});
});
test
(
"browser"
,
function
()
{
expect
(
13
);
var
browsers
=
{
//Internet Explorer
"Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)"
:
"6.0"
,
"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)"
:
"7.0"
,
/** Failing #1876
* "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)": "7.0",
*/
//Browsers with Gecko engine
//Mozilla
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915"
:
"1.7.12"
,
//Firefox
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"
:
"1.8.1.3"
,
//Netscape
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20070321 Netscape/8.1.3"
:
"1.7.5"
,
//Flock
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070321 Firefox/1.5.0.11 Flock/0.7.12"
:
"1.8.0.11"
,
//Opera browser
"Opera/9.20 (X11; Linux x86_64; U; en)"
:
"9.20"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.20"
:
"9.20"
,
"Mozilla/5.0 (Windows NT 5.1; U; pl; rv:1.8.0) Gecko/20060728 Firefox/1.5.0 Opera 9.20"
:
"9.20"
,
//WebKit engine
"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3"
:
"418.9"
,
"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3"
:
"418.8"
,
"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/312.8 (KHTML, like Gecko) Safari/312.5"
:
"312.8"
,
//Other user agent string
"Other browser's user agent 1.0"
:
null
};
for
(
var
i
in
browsers
)
{
var
v
=
i
.
toLowerCase
().
match
(
/.+
(?:
rv|it|ra|ie
)[\/
:
]([\d
.
]
+
)
/
);
// RegEx from Core jQuery.browser.version check
version
=
v
?
v
[
1
]
:
null
;
equals
(
version
,
browsers
[
i
],
"Checking UA string"
);
}
});
test
(
"noConflict"
,
function
()
{
test
(
"noConflict"
,
function
()
{
expect
(
6
);
expect
(
6
);
...
...
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