|
15 | 15 | }
|
16 | 16 | });
|
17 | 17 |
|
18 |
| - asyncTest( "changepage runs once when called with an element", function(){ |
19 |
| - var called = 0, |
20 |
| - newChangePage = function(a,b,c,d,e){ |
21 |
| - changePageFn( a,b,c,d,e ); |
22 |
| - called ++; |
23 |
| - }; |
24 |
| - |
25 |
| - $.testHelper.sequence([ |
26 |
| - // avoid initial page load triggering changePage early |
27 |
| - function(){ |
28 |
| - $.mobile.changePage = newChangePage; |
29 |
| - newChangePage($("#bar")); |
30 |
| - }, |
31 |
| - |
32 |
| - function(){ |
33 |
| - ok(called == 1, "change page should be called once"); |
34 |
| - $.mobile.changePage = changePageFn; |
35 |
| - start(); |
36 |
| - }], 500); |
37 |
| - }); |
38 |
| - |
39 |
| - asyncTest( "changepage runs twice when triggered by a link", function(){ |
40 |
| - var called = 0, |
41 |
| - newChangePage = function(a,b,c,d,e){ |
42 |
| - changePageFn( a,b,c,d,e ); |
43 |
| - called ++; |
44 |
| - }; |
45 |
| - |
46 |
| - $.testHelper.sequence([ |
47 |
| - // avoid initial page load triggering changePage early |
48 |
| - function(){ |
49 |
| - $.mobile.changePage = newChangePage; |
50 |
| - $('#foo a').click(); |
51 |
| - }, |
52 |
| - |
53 |
| - function(){ |
54 |
| - ok(called == 2, "change page should be called twice"); |
55 |
| - $.mobile.changePage = changePageFn; |
56 |
| - start(); |
57 |
| - }], 500); |
58 |
| - }); |
59 |
| - |
60 | 18 | asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){
|
61 | 19 | var called = false;
|
62 | 20 | var newChangePage = function(){
|
|
306 | 264 | });
|
307 | 265 |
|
308 | 266 | asyncTest( "Page title updates properly when clicking back to previous page", function(){
|
309 |
| - $.testHelper.openPage("#relative-after-embeded-page-first"); |
| 267 | + $.testHelper.pageSequence([ |
| 268 | + function(){ |
| 269 | + $.testHelper.openPage("#relative-after-embeded-page-first"); |
| 270 | + }, |
310 | 271 |
|
311 |
| - $.testHelper.sequence([ |
312 | 272 | function(){
|
313 | 273 | window.history.back();
|
314 | 274 | },
|
|
317 | 277 | same(document.title, "jQuery Mobile Navigation Test Suite");
|
318 | 278 | start();
|
319 | 279 | }
|
320 |
| - ], 500); |
| 280 | + ]); |
321 | 281 | });
|
322 | 282 |
|
323 | 283 | asyncTest( "Page title updates properly from title tag when loading an external page", function(){
|
324 |
| - $.testHelper.openPage("#ajax-title-page"); |
| 284 | + $.testHelper.pageSequence([ |
| 285 | + function(){ |
| 286 | + $.testHelper.openPage("#ajax-title-page"); |
| 287 | + }, |
325 | 288 |
|
326 |
| - $.testHelper.sequence([ |
327 | 289 | function(){
|
328 | 290 | $("#titletest1").click();
|
329 | 291 | },
|
|
332 | 294 | same(document.title, "Title Tag");
|
333 | 295 | start();
|
334 | 296 | }
|
335 |
| - ], 500); |
| 297 | + ]); |
336 | 298 | });
|
337 | 299 |
|
338 | 300 | asyncTest( "Page title updates properly from data-title attr when loading an external page", function(){
|
339 |
| - $.testHelper.openPage("#ajax-title-page"); |
340 |
| - $.testHelper.sequence([ |
| 301 | + $.testHelper.pageSequence([ |
| 302 | + function(){ |
| 303 | + $.testHelper.openPage("#ajax-title-page"); |
| 304 | + }, |
| 305 | + |
341 | 306 | function(){
|
342 | 307 | $("#titletest2").click();
|
343 | 308 | },
|
|
346 | 311 | same(document.title, "Title Attr");
|
347 | 312 | start();
|
348 | 313 | }
|
349 |
| - ], 500); |
| 314 | + ]); |
350 | 315 | });
|
351 | 316 |
|
352 | 317 | asyncTest( "Page title updates properly from heading text in header when loading an external page", function(){
|
|
364 | 329 | });
|
365 | 330 |
|
366 | 331 | asyncTest( "Page links to the current active page result in the same active page", function(){
|
367 |
| - $.testHelper.openPage("#self-link"); |
368 |
| - $.testHelper.sequence([ |
| 332 | + $.testHelper.pageSequence([ |
| 333 | + function(){ |
| 334 | + $.testHelper.openPage("#self-link"); |
| 335 | + }, |
| 336 | + |
369 | 337 | function(){
|
370 | 338 | $("a[href='#self-link']").click();
|
371 | 339 | },
|
|
374 | 342 | same($.mobile.activePage[0], $("#self-link")[0], "self-link page is still the active page" );
|
375 | 343 | start();
|
376 | 344 | }
|
377 |
| - ], 500); |
| 345 | + ]); |
378 | 346 | });
|
379 | 347 |
|
380 |
| - asyncTest( "links on subdirectory pages with query params use an absolute path", function(){ |
381 |
| - $.testHelper.sequence([ |
| 348 | + asyncTest( "links on subdirectory pages with query params append the params and load the page", function(){ |
| 349 | + $.testHelper.pageSequence([ |
382 | 350 | function(){
|
383 | 351 | $.testHelper.openPage("#data-url-tests/non-data-url.html");
|
384 | 352 | },
|
|
389 | 357 |
|
390 | 358 | function(){
|
391 | 359 | same(location.hash, "#data-url-tests/non-data-url.html?foo=bar");
|
392 |
| - ok($(".ui-page-active").jqmData("url").indexOf("?foo=bar") > -1, "the query params are in the hash"); |
| 360 | + ok($(".ui-page-active").jqmData("url").indexOf("?foo=bar") > -1, "the query params are in the data url"); |
393 | 361 | start();
|
394 | 362 | }
|
395 |
| - ], 1000); |
| 363 | + ]); |
396 | 364 | });
|
397 | 365 |
|
398 | 366 | asyncTest( "identical query param link doesn't add additional set of query params", function(){
|
|
0 commit comments