Skip to content

Commit

Permalink
Bug 1004668 - Update robocop testUITelemetry; r=rnewman
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrownmozilla committed May 9, 2014
1 parent 146e37b commit 75486c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions mobile/android/base/tests/robocop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ skip-if = android_version == "10"
[testSharedPreferences]
[testSimpleDiscovery]
[testUITelemetry]
# disabled on 2.2, see bug 993813
skip-if = android_version == "8"
[testVideoDiscovery]

# Used for Talos, please don't use in mochitest
Expand Down
15 changes: 8 additions & 7 deletions mobile/android/base/tests/testUITelemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ add_test(function test_telemetry_events() {

let expected = [
["event", TEST_PREFIX + "enone", "method0", [], null],
["event", TEST_PREFIX + "efoo", "method1", ["foo"], null],
["event", TEST_PREFIX + "efoo", "method2", ["foo"], null],
["event", TEST_PREFIX + "efoobar", "method3", ["foo", "bar"], "foobarextras"],
["event", TEST_PREFIX + "efoo", "method1", [TEST_PREFIX + "foo"], null],
["event", TEST_PREFIX + "efoo", "method2", [TEST_PREFIX + "foo"], null],
["event", TEST_PREFIX + "efoobar", "method3", [TEST_PREFIX + "foo", TEST_PREFIX + "bar"], "foobarextras"],
["session", TEST_PREFIX + "foo", "reasonfoo"],
["event", TEST_PREFIX + "ebar", "method4", ["bar"], "barextras"],
["event", TEST_PREFIX + "ebar", "method4", [TEST_PREFIX + "bar"], "barextras"],
["session", TEST_PREFIX + "bar", "reasonbar"],
["event", TEST_PREFIX + "enone", "method5", [], null],
];
Expand All @@ -62,20 +62,21 @@ add_test(function test_telemetry_events() {
for (let i = 0; i < measurements.length; ++i) {
let m = measurements[i];

let type = m[0];
let type = m.type;
if (type == "event") {
let [type, action, method, sessions, extras] = expected[i];
do_check_eq(m.action, action);
do_check_eq(m.method, method);
do_check_array_eq(m.sessions, sessions);
// might receive real sessions in addition to the test ones -- remove the real ones
do_check_array_eq(m.sessions.filter(s => TEST_REGEX.test(s)), sessions);
do_check_eq(m.extras, extras);
continue;
}

if (type == "session") {
let [type, name, reason] = expected[i];
do_check_eq(m.name, name);
do_check_eq(m.reason, method);
do_check_eq(m.reason, reason);
continue;
}
}
Expand Down

0 comments on commit 75486c1

Please sign in to comment.