소스 검색

Bugfixes to make profiling work again.

JC Brand 10 년 전
부모
커밋
3afc0e58bc
1개의 변경된 파일3개의 추가작업 그리고 9개의 파일을 삭제
  1. 3 9
      spec/profiling.js

+ 3 - 9
spec/profiling.js

@@ -9,6 +9,7 @@
     );
     );
 } (this, function ($, mock, test_utils) {
 } (this, function ($, mock, test_utils) {
     var Strophe = converse_api.env.Strophe;
     var Strophe = converse_api.env.Strophe;
+    var $iq = converse_api.env.$iq;
 
 
     describe("Profiling", function() {
     describe("Profiling", function() {
         beforeEach(function() {
         beforeEach(function() {
@@ -19,7 +20,6 @@
 
 
         xit("adds hundreds of contacts to the roster", $.proxy(function() {
         xit("adds hundreds of contacts to the roster", $.proxy(function() {
             converse.roster_groups = false;
             converse.roster_groups = false;
-            spyOn(this.roster, 'clearCache').andCallThrough();
             expect(this.roster.pluck('jid').length).toBe(0);
             expect(this.roster.pluck('jid').length).toBe(0);
             var stanza = $iq({
             var stanza = $iq({
                 to: this.connection.jid,
                 to: this.connection.jid,
@@ -30,7 +30,7 @@
             });
             });
             _.each(['Friends', 'Colleagues', 'Family', 'Acquaintances'], function (group) {
             _.each(['Friends', 'Colleagues', 'Family', 'Acquaintances'], function (group) {
                 var i;
                 var i;
-                for (i=0; i<100; i++) {
+                for (i=0; i<50; i++) {
                     stanza = stanza.c('item', {
                     stanza = stanza.c('item', {
                         jid: Math.random().toString().replace('0.', '')+'@example.net',
                         jid: Math.random().toString().replace('0.', '')+'@example.net',
                         subscription:'both'
                         subscription:'both'
@@ -38,14 +38,12 @@
                 }
                 }
             });
             });
             this.roster.onReceivedFromServer(stanza.tree());
             this.roster.onReceivedFromServer(stanza.tree());
-            expect(this.roster.clearCache).toHaveBeenCalled();
-            expect(this.roster.pluck('jid').length).toBe(400);
+            // expect(this.roster.pluck('jid').length).toBe(400);
         }, converse));
         }, converse));
 
 
         xit("adds hundreds of contacts to the roster, with roster groups", $.proxy(function() {
         xit("adds hundreds of contacts to the roster, with roster groups", $.proxy(function() {
             // converse.show_only_online_users = true;
             // converse.show_only_online_users = true;
             converse.roster_groups = true;
             converse.roster_groups = true;
-            spyOn(this.roster, 'clearCache').andCallThrough();
             expect(this.roster.pluck('jid').length).toBe(0);
             expect(this.roster.pluck('jid').length).toBe(0);
             var stanza = $iq({
             var stanza = $iq({
                 to: this.connection.jid,
                 to: this.connection.jid,
@@ -64,11 +62,7 @@
                 }
                 }
             });
             });
             this.roster.onReceivedFromServer(stanza.tree());
             this.roster.onReceivedFromServer(stanza.tree());
-            expect(this.roster.clearCache).toHaveBeenCalled();
             //expect(this.roster.pluck('jid').length).toBe(400);
             //expect(this.roster.pluck('jid').length).toBe(400);
         }, converse));
         }, converse));
-
-        it("contacts in a very large roster change their statuses", $.proxy(function() {
-        }, converse));
     });
     });
 }));
 }));