jstd = jstestdriver; dump = bind(jstd.console, jstd.console.log); function nakedExpect(obj) { return expect(angular.fromJson(angular.toJson(obj))); }; swfobject = { createSwf:function() { fail("must mock out swfobject.createSwf in test."); } }; function html(content) { return jQuery("
").html(content); } function report(reportTest){ $("#tests").children().each(function(i){ var success = this.className == "pass"; var strong = this.firstChild; var msg = strong.firstChild.nodeValue; var parts = msg.split(" module: "); var module = parts[0]; var name = parts[1].replace(/ *$/, ""); reportTest(success, module, name, this.nodeValue); }); } MockLocation = function() { this.url = "http://server"; }; MockLocation.prototype.get = function(){ return this.url; }; MockLocation.prototype.set = function(url){ this.url = url; }; function childNode(element, index) { return jqLite(element[0].childNodes[index]); } function sortedHtml(element) { var html = ""; (function toString(node) { if (node.nodeName == "#text") { html += escapeHtml(node.nodeValue); } else { html += '<' + node.nodeName.toLowerCase(); var attributes = node.attributes || []; var attrs = []; for(var i=0; i