(t *testing.T)
| 2670 | } |
| 2671 | |
| 2672 | func TestHandleSessionUpdateSessToForeground(t *testing.T) { |
| 2673 | topicName := "usrMe" |
| 2674 | numUsers := 1 |
| 2675 | helper := TopicTestHelper{} |
| 2676 | helper.setUp(t, numUsers, types.TopicCatMe, topicName /*attach=*/, true) |
| 2677 | defer helper.tearDown() |
| 2678 | |
| 2679 | uid := helper.uids[0] |
| 2680 | supd := &sessionUpdate{ |
| 2681 | sess: helper.sessions[0], |
| 2682 | } |
| 2683 | var uaAgent string |
| 2684 | helper.topic.handleSessionUpdate(supd, &uaAgent, nil) |
| 2685 | helper.finish() |
| 2686 | |
| 2687 | // Check for errors from testHubLoop |
| 2688 | if errorMsgs, hasError := helper.hubMessages["__ERROR__"]; hasError { |
| 2689 | t.Fatal(errorMsgs[0].Ctrl.Text) |
| 2690 | } |
| 2691 | |
| 2692 | // Expect online count bumped up to 2. |
| 2693 | if online := helper.topic.perUser[uid].online; online != 2 { |
| 2694 | t.Errorf("online count for %s: expected 2, found %d", uid.UserId(), online) |
| 2695 | } |
| 2696 | } |
| 2697 | |
| 2698 | func TestHandleSessionUpdateUserAgent(t *testing.T) { |
| 2699 | topicName := "usrMe" |
nothing calls this directly
no test coverage detected
searching dependent graphs…