<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="/js-test-resources/js-test.js"></script> | |
<script> | |
description('Test to verify XMLHttpRequest.send(...), with an object, calls toString exactly once.'); | |
var testObj = new function() { | |
this.callCounter = 0; | |
this.toString = function() { | |
this.callCounter++; | |
return 'Hello World'; | |
}; | |
} | |
xhr = new XMLHttpRequest; | |
xhr.open('GET', 'resources/get.txt', true); | |
xhr.send(testObj); | |
shouldBe('testObj.callCounter', '1'); | |
</script> | |
</head> | |
</html> |