Skip to content

Commit 3737d17

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 63c94d9 + 866b1b0 commit 3737d17

File tree

14 files changed

+384
-232
lines changed

14 files changed

+384
-232
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ JSFILES = js/jquery.ui.widget.js \
6060
js/jquery.mobile.forms.button.js \
6161
js/jquery.mobile.forms.slider.js \
6262
js/jquery.mobile.forms.textinput.js \
63+
js/jquery.mobile.forms.select.custom.js \
6364
js/jquery.mobile.forms.select.js \
6465
js/jquery.mobile.buttonMarkup.js \
6566
js/jquery.mobile.controlGroup.js \
@@ -126,7 +127,7 @@ notify:
126127
@@echo "The files have been built and are in " $$(pwd)/${OUTPUT}
127128

128129
# Pull the latest commits. This is used for the nightly build but can be used to save some keystrokes
129-
pull:
130+
pull:
130131
@@git pull --quiet
131132

132133
# Zip the 4 files and the theme images into one convenient package
@@ -161,7 +162,7 @@ nightly: pull zip
161162
# Change the empty paths to the location of this nightly file
162163
@@find ${VER} -type f -name '*.html' -exec sed -i 's|href="themes/default/"|href="${NIGHTLY_WEBPATH}/${DIR}.min.css"|g' {} \;
163164
@@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/jquery.js"|src="http://code.jquery.com/jquery-${JQUERY}.min.js"|' {} \;
164-
@@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/"|src="${NIGHTLY_WEBPATH}/${DIR}.min.js"|g' {} \;
165+
@@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/"|src="${NIGHTLY_WEBPATH}/${DIR}.min.js"|g' {} \;
165166

166167
# Move the demos into the output folder
167168
@@mv ${VER} ${OUTPUT}/demos

build.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
js/jquery.mobile.core.js,
3131
js/jquery.mobile.navigation.js,
3232
js/jquery.mobile.transition.js,
33-
js/jquery.mobile.degradeInputs.js,
33+
js/jquery.mobile.degradeInputs.js,
3434
js/jquery.mobile.dialog.js,
3535
js/jquery.mobile.page.sections.js,
3636
js/jquery.mobile.collapsible.js,
@@ -44,6 +44,7 @@
4444
js/jquery.mobile.forms.button.js,
4545
js/jquery.mobile.forms.slider.js,
4646
js/jquery.mobile.forms.textinput.js,
47+
js/jquery.mobile.forms.select.custom.js,
4748
js/jquery.mobile.forms.select.js,
4849
js/jquery.mobile.buttonMarkup.js,
4950
js/jquery.mobile.controlGroup.js,

docs/lists/lists-split-purchase.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515

1616

17-
<div data-role="page" class="type-interior">
17+
<div data-role="page">
1818

1919
<div data-role="header" data-theme="a">
2020
<h1>Purchase?</h1>

js/jquery.mobile.forms.select.custom.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,11 @@
248248
// rebind the page remove that was unbound in the open function
249249
// to allow for the parent page removal from actions other than the use
250250
// of a dialog sized custom select
251-
self.thisPage.bind( "pagehide.remove", function() {
252-
$(this).remove();
253-
});
251+
if( !self.thisPage.data("page").options.domCache ){
252+
self.thisPage.bind( "pagehide.remove", function() {
253+
$(this).remove();
254+
});
255+
}
254256

255257
// doesn't solve the possible issue with calling change page
256258
// where the objects don't define data urls which prevents dialog key
@@ -459,9 +461,11 @@
459461
});
460462
};
461463

462-
$( "select:jqmData(native-menu='false')" ).live( "selectmenubeforecreate", function(){
464+
$( "select" ).live( "selectmenubeforecreate", function(){
463465
var selectmenuWidget = $( this ).data( "selectmenu" );
464466

465-
extendSelect( selectmenuWidget );
467+
if( !selectmenuWidget.options.nativeMenu ){
468+
extendSelect( selectmenuWidget );
469+
}
466470
});
467471
})( jQuery );

tests/unit/index.php

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,38 @@
33
<head>
44
<meta charset="utf-8">
55
<link rel="stylesheet" href="../../external/qunit.css"></link>
6+
<script src="../../js/jquery.js"></script>
7+
<script src="../../external/qunit.js"></script>
8+
<script src="runner.js"></script>
9+
<style type="text/css">
10+
html, body {
11+
width:100%;
12+
height:100%;
13+
margin:0px;
14+
padding:0px;
15+
}
16+
17+
#testFrame {
18+
float: left;
19+
border: 0px;
20+
height: 100%;
21+
width: 60%;
22+
}
23+
24+
#results {
25+
float: left;
26+
width: 30%;
27+
}
28+
</style>
629
</head>
730
<body>
8-
<div style="float: left; width: 500px;">
31+
<div id="results">
932
<h1 id="qunit-header"><a href="#">jQuery Mobile Test Suite</a></h1>
1033
<h2 id="qunit-banner"></h2>
1134
<ol id="qunit-tests">
1235
</ol>
1336
</div>
14-
<!-- under normal circumstances inline styles would be a poor choice, but in this case
15-
I think an entire link and stylesheet is a waste -->
16-
<iframe data-src="../../tests/unit/{{testdir}}" name="testFrame" id="testFrame" width="800px" height="100%" style="float: left; border: 0px; height: 100%;" scrolling="no">
37+
<iframe data-src="../../tests/unit/{{testdir}}" name="testFrame" id="testFrame" scrolling="no">
1738
</iframe>
18-
<script src="../../js/jquery.js"></script>
19-
<script src="../../external/qunit.js"></script>
20-
<script src="runner.js"></script>
2139
</body>
2240
</html>

tests/unit/ls.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
closedir($handle);
1414
}
1515

16-
sort($directories);
17-
echo json_encode( array('directories' => $directories ));
16+
$test_pages = array_merge($directories, glob("**/*-tests.html"));
17+
sort($test_pages);
18+
19+
echo json_encode( array('testPages' => $test_pages));
1820
?>

tests/unit/navigation/base-tests/content/content-page-2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="../app-base/base-page-1.html" class="bp1">Base Page 1</a>
99
<a href="../../#internal-page-1" class="ip1">Internal Page 1</a>
1010
<a href="../../#internal-page-2" class="ip2">Internal Page 2</a>
11-
<img src="images/content-page-2.png">
11+
<img src="images/content-page-2.png">
1212
</div>
1313
</body>
1414
</html>

tests/unit/navigation/navigation_base.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$.testHelper.pageSequence([
2222
function(){
2323
// Navigate from default internal page to another internal page.
24-
$.testHelper.openPage("#internal-page-2");
24+
$.testHelper.openPage("#internal-page-2");
2525
},
2626

2727
function(){
@@ -93,8 +93,8 @@
9393
// Verify that we are on the expected page.
9494
same(location.hash, "#" + contentDir + "content-page-2.html", "call changePage() with a relative path should resolve relative to current page");
9595

96-
// Try calling changePage() with an id
97-
$.mobile.changePage("#internal-page-2");
96+
// test that an internal page works
97+
$("a.ip2").click();
9898
},
9999

100100
function(){

tests/unit/runner.js

Lines changed: 76 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,82 @@
1-
(function(){
2-
var test = function(data){
3-
var $frameElem = $("#testFrame"),
4-
template = $frameElem.attr("data-src"),
5-
updateFrame = function(dir){
6-
return $frameElem.attr("src", template.replace("{{testdir}}", dir));
7-
};
8-
9-
$.each(data.directories, function(i, dir){
10-
asyncTest( dir, function(){
11-
var testTimeout = 3 * 60 * 1000, checkInterval = 2000;
1+
$(function() {
2+
var Runner = function( ) {
3+
var self = this;
124

5+
$.extend( self, {
6+
frame: window.frames[ "testFrame" ],
7+
8+
testTimeout: 3 * 60 * 1000,
9+
10+
$frameElem: $( "#testFrame" ),
11+
12+
assertionResultPrefix: "assertion result for test:",
13+
14+
onTimeout: QUnit.start,
15+
16+
onFrameLoad: function() {
1317
// establish a timeout for a given suite in case of async tests hanging
14-
var testTimer = setTimeout( function(){
15-
// prevent any schedule checks for completion
16-
clearTimeouts();
17-
start();
18-
}, testTimeout ),
19-
20-
checkTimer = setInterval( check, checkInterval ),
21-
22-
clearTimeouts = function(){
23-
// prevent the next interval of the check function and the test timeout
24-
clearTimeout( checkTimer );
25-
clearTimeout( testTimer );
26-
};
27-
28-
// check the iframe for success or failure and respond accordingly
29-
function check(){
30-
// check for the frames jquery object each time
31-
var framejQuery = window.frames["testFrame"].jQuery;
32-
33-
// if the iframe hasn't loaded (ie loaded jQuery) check back again shortly
34-
if( !framejQuery ) return;
35-
36-
// grab the result of the iframe test suite
37-
// TODO strip extra white space
38-
var result = framejQuery( "#qunit-banner" ).attr( "class" );
39-
40-
// if we have a result check it, otherwise check back shortly
41-
if( result ){
42-
ok( result === "qunit-pass" );
43-
clearTimeouts();
44-
start();
45-
}
46-
};
47-
48-
expect( 1 );
49-
50-
// set the test suite page on the iframe
51-
updateFrame( dir );
52-
});
18+
self.testTimer = setTimeout( self.onTimeout, self.testTimeout );
19+
20+
// when the QUnit object reports done in the iframe
21+
// run the onFrameDone method
22+
self.frame.QUnit.done = self.onFrameDone;
23+
self.frame.QUnit.testDone = self.onTestDone;
24+
},
25+
26+
onTestDone: function( name, bad, assertCount ) {
27+
QUnit.ok( !bad, name );
28+
self.recordAssertions( assertCount - 1, name );
29+
},
30+
31+
onFrameDone: function( failed, passed, total, runtime ){
32+
// make sure we don't time out the tests
33+
clearTimeout( self.testTimer );
34+
35+
// TODO decipher actual cause of multiple test results firing twice
36+
// clear the done call to prevent early completion of other test cases
37+
self.frame.QUnit.done = $.noop;
38+
self.frame.QUnit.testDone = $.noop;
39+
40+
// hide the extra assertions made to propogate the count
41+
// to the suite level test
42+
self.hideAssertionResults();
43+
44+
// continue on to the next suite
45+
QUnit.start();
46+
},
47+
48+
recordAssertions: function( count, parentTest ) {
49+
for( var i = 0; i < count; i++ ) {
50+
ok( true, self.assertionResultPrefix + parentTest );
51+
}
52+
},
53+
54+
hideAssertionResults: function() {
55+
$( "li:not([id]):contains('" + self.assertionResultPrefix + "')" ).hide();
56+
},
57+
58+
exec: function( data ) {
59+
var template = self.$frameElem.attr( "data-src" );
60+
61+
$.each( data.testPages, function(i, dir) {
62+
QUnit.asyncTest( dir, function() {
63+
self.dir = dir;
64+
self.$frameElem.one( "load", self.onFrameLoad );
65+
self.$frameElem.attr( "src", template.replace("{{testdir}}", dir) );
66+
});
67+
});
68+
69+
// having defined all suite level tests let QUnit run
70+
QUnit.start();
71+
}
5372
});
5473
};
5574

75+
// prevent qunit from starting the test suite until all tests are defined
76+
QUnit.begin = function( ) {
77+
this.config.autostart = false;
78+
};
79+
5680
// get the test directories
57-
$.get("ls.php", test);
58-
})();
81+
$.get( "ls.php", (new Runner()).exec );
82+
});
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
</head>
6+
<body>
7+
<div id="dialog-select-parent-domcache-test" data-nstest-role="page" data-nstest-dom-cache="true">
8+
<div data-nstest-role="fieldcontain" id="domcache-page-select-container">
9+
<label for="domcache-page-select" class="select">Your state:</label>
10+
<select name="domcache-page-select" id="domcache-page-select" data-nstest-native-menu="false">
11+
<option value="AL">Alabama</option>
12+
<option value="AK">Alaska</option>
13+
<option value="AZ">Arizona</option>
14+
<option value="AR">Arkansas</option>
15+
<option value="CA">California</option>
16+
<option value="CO">Colorado</option>
17+
<option value="CT">Connecticut</option>
18+
<option value="DE">Delaware</option>
19+
<option value="FL">Florida</option>
20+
<option value="GA">Georgia</option>
21+
<option value="HI">Hawaii</option>
22+
<option value="ID">Idaho</option>
23+
<option value="IL">Illinois</option>
24+
<option value="IN">Indiana</option>
25+
<option value="IA">Iowa</option>
26+
<option value="KS">Kansas</option>
27+
<option value="KY">Kentucky</option>
28+
<option value="LA">Louisiana</option>
29+
<option value="ME">Maine</option>
30+
<option value="MD">Maryland</option>
31+
<option value="MA">Massachusetts</option>
32+
<option value="MI">Michigan</option>
33+
<option value="MN">Minnesota</option>
34+
<option value="MS">Mississippi</option>
35+
<option value="MO">Missouri</option>
36+
<option value="MT">Montana</option>
37+
<option value="NE">Nebraska</option>
38+
<option value="NV">Nevada</option>
39+
<option value="NH">New Hampshire</option>
40+
<option value="NJ">New Jersey</option>
41+
<option value="NM">New Mexico</option>
42+
<option value="NY">New York</option>
43+
<option value="NC">North Carolina</option>
44+
<option value="ND">North Dakota</option>
45+
<option value="OH">Ohio</option>
46+
<option value="OK">Oklahoma</option>
47+
<option value="OR">Oregon</option>
48+
<option value="PA">Pennsylvania</option>
49+
<option value="RI">Rhode Island</option>
50+
<option value="SC">South Carolina</option>
51+
<option value="SD">South Dakota</option>
52+
<option value="TN">Tennessee</option>
53+
<option value="TX">Texas</option>
54+
<option value="UT">Utah</option>
55+
<option value="VT">Vermont</option>
56+
<option value="VA">Virginia</option>
57+
<option value="WA">Washington</option>
58+
<option value="WV">West Virginia</option>
59+
<option value="WI">Wisconsin</option>
60+
<option value="WY">Wyoming</option>
61+
</select>
62+
</div>
63+
</div>
64+
</body>
65+
</html>

0 commit comments

Comments
 (0)