Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/198178

Change subject: Make AJAX callback test harder to pass
......................................................................

Make AJAX callback test harder to pass

The old test passed a callback as an option which was easy to
hijack and wrap. Pass the callback as a handler to a child promise
of the jqXHR object instead - this is both more typical usage and
more complicated to pass.

Bug: T92247
Change-Id: I3f9256fb68dd5cbad161fde33e3ea9a3edc6489c
---
M modules/ext.Buggy.ajax.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Buggy 
refs/changes/78/198178/1

diff --git a/modules/ext.Buggy.ajax.js b/modules/ext.Buggy.ajax.js
index b92a01d..1cc1465 100644
--- a/modules/ext.Buggy.ajax.js
+++ b/modules/ext.Buggy.ajax.js
@@ -1,4 +1,4 @@
 /*jshint undef:false */
 ( function ( $ ) {
-       $.get( '/wiki/Main_Page', { success: function() { 
callANonExistentFunctionOnAjaxSuccess(); } } );
+       $.when( $.get( '/wiki/Main_Page'), $.when( 1 ) ).done( function() { 
callANonExistentFunctionOnAjaxSuccess(); } );
 }( jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/198178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f9256fb68dd5cbad161fde33e3ea9a3edc6489c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to