File tree Expand file tree Collapse file tree 6 files changed +24
-17
lines changed
tests/integration/navigation Expand file tree Collapse file tree 6 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ define(["jquery",
5050 // is not fired.
5151 window . history . replaceState ( state , state . title || document . title , href ) ;
5252
53+ // If we haven't yet received the initial popstate, we need to update the reference
54+ // href so that we compare against the correct location
55+ if ( this . ignoreInitialHashChange ) {
56+ initialHref = href ;
57+ }
58+
5359 return state ;
5460 } ,
5561
Original file line number Diff line number Diff line change 11define ( [ "jquery" ] , function ( $ ) {
22
33// TODO: Attaching early to popstate like this becomes unnecessary once the navigate event has been
4- // properly implemented in that it removes its popstate handler upon teardown and attaches it upon
4+ // properly implemented so that it removes its popstate handler upon teardown and attaches it upon
55// setup, rather than attaching it upon setup and then simply making sure upon subsequent calls to
66// setup that the handlers are attached.
77$ ( window ) . on ( "popstate" , function ( event ) {
Original file line number Diff line number Diff line change 1212 < link rel ="stylesheet " href ="../../../../external/qunit/qunit.css "/>
1313 < link rel ="stylesheet " href ="../../../jqm-tests.css "/>
1414 < script >
15- $ . testHelper . asyncLoad ( [
15+ $ . testHelper . asyncLoad ( [
1616 [ "early_popstate_handler.js" ] ,
1717 [ "events/navigate" ] ,
1818 [ "event_core.js" ]
Original file line number Diff line number Diff line change 99 < script src ="../../../../js/jquery.tag.inserter.js "> </ script >
1010 < script >
1111 $ ( document ) . bind ( 'mobileinit' , function ( ) {
12+
1213 // Expect content to inherit this theme when not explicitly set
1314 $ . mobile . page . prototype . options . contentTheme = "d" ;
15+ $ . testHelper . setPushState ( ) ;
1416 } ) ;
1517 </ script >
1618 < script src ="../../../jquery.setNameSpace.js "> </ script >
Original file line number Diff line number Diff line change 99 < script src ="../../../../js/jquery.tag.inserter.js "> </ script >
1010 < script >
1111 $ ( document ) . bind ( 'mobileinit' , function ( ) {
12+
1213 // Expect content to inherit this theme when not explicitly set
1314 $ . mobile . page . prototype . options . contentTheme = "d" ;
15+ $ . testHelper . setPushState ( ) ;
1416 } ) ;
1517 </ script >
1618 < script src ="../../../jquery.setNameSpace.js "> </ script >
2123 $ . testHelper . asyncLoad ( [
2224 [
2325 "widgets/dialog" ,
24- "widgets/page" ,
26+ "widgets/page.dialog " ,
2527 "widgets/popup"
2628 ] ,
2729 [ "init" ] ,
3133 ] , "../../../../js" ) ;
3234 </ script >
3335
34-
3536 < link rel ="stylesheet " href ="../../../../css/themes/default/jquery.mobile.css "/>
3637 < link rel ="stylesheet " href ="../../../../external/qunit/qunit.css "/>
37-
3838 < script src ="../../../swarminject.js "> </ script >
3939</ head >
4040< body >
4141
42- < div id ="qunit "> </ div >
42+ < div id ="qunit "> </ div >
4343
44- < div data-nstest-role ="page " id ="sequenceRedirect "> </ div >
45- < div id ="internal-page " data-nstest-role ="page "> </ div >
44+ < div data-nstest-role ="page " id ="sequenceRedirect "> </ div >
45+ < div id ="internal-page " data-nstest-role ="page "> </ div >
4646
47- <!--
48- This test page is used when testing initial URLs of the form
49- http://domain/path/to/page1.html#/path/to/page2.html. It really only works if
50- you load sequence-tests.html via the hash, i.e.,
51- http://domain/path/to/sequence/index.html#/path/to/sequence-redirect.html
52- -->
47+ <!--
48+ This test page is used when testing initial URLs of the form
49+ http://domain/path/to/page1.html#/path/to/page2.html. It really only works if
50+ you load sequence-tests.html via the hash, i.e.,
51+ http://domain/path/to/sequence/index.html#/path/to/sequence-redirect.html
52+ -->
5353
5454</ body >
5555</ html >
Original file line number Diff line number Diff line change 99 // The more we click around the test pages and the more combinations of paths
1010 // we try, the better.
1111
12- $ . testHelper . setPushState ( ) ;
13-
1412 // If the start page is not there, wait for it to appear. Otherwise, leave
1513 // some time before starting the actual run to allow the popstate handler to
1614 // awaken from its slumber
4644
4745 maybeWaitForStartPage ( [
4846 function ( ) {
49- origUrl = location . href . replace ( "&ui-state=dialog" , "" ) ;
47+ origUrl = $ . mobile . path . parseUrl (
48+ location . href . replace ( "&ui-state=dialog" , "" ) ) . hrefNoHash ;
5049 $ ( "#openInternalPage" ) . click ( ) ;
5150 } ,
5251 {
You can’t perform that action at this time.
0 commit comments