@@ -414,30 +414,22 @@ describe('integration', function () {
414
414
) ;
415
415
} ) ;
416
416
417
- it ( 'should NOT capture breadcrumbs from XMLHttpRequests to the Sentry store endpoint' , function ( done ) {
417
+ it ( 'should NOT denote XMLHttpRequests to the Sentry store endpoint as requiring breadcrumb capture ' , function ( done ) {
418
418
var iframe = this . iframe ;
419
419
iframeExecute ( iframe , done ,
420
420
function ( ) {
421
- // some browsers trigger onpopstate for load / reset breadcrumb state
422
- Raven . _breadcrumbs = [ ] ;
423
-
424
421
var xhr = new XMLHttpRequest ( ) ;
425
- xhr . open ( 'GET' , 'https://example.com/api/1/store/?sentry_key=public' ) ;
426
- xhr . setRequestHeader ( 'Content-type' , 'application/json' ) ;
427
- xhr . onreadystatechange = function ( ) {
428
- // don't fire `done` handler until at least *one* onreadystatechange
429
- // has occurred (doesn't actually need to finish)
430
- if ( xhr . readyState === 4 ) {
431
- setTimeout ( done ) ;
432
- }
433
- } ;
434
- xhr . send ( ) ;
422
+ xhr . open ( 'GET' , 'http://example.com/api/1/store/?sentry_key=public' ) ;
423
+
424
+ // can't actually transmit an XHR (breadcrumb isnt recorded until
425
+ // onreadystatechange fires), so enough to just verify that
426
+ // __raven_xhr wasn't set on xhr object
427
+
428
+ window . ravenData = xhr . hasOwnProperty ( '__raven_xhr' ) ;
429
+ setTimeout ( done ) ;
435
430
} ,
436
431
function ( ) {
437
- var Raven = iframe . contentWindow . Raven ,
438
- breadcrumbs = Raven . _breadcrumbs ;
439
-
440
- assert . equal ( breadcrumbs . length , 0 ) ;
432
+ assert . isFalse ( iframe . contentWindow . ravenData ) ;
441
433
}
442
434
) ;
443
435
} ) ;
0 commit comments