Bug 1004668 - Update robocop testUITelemetry. r=rnewman, a=test-only
authorGeoff Brown <gbrown@mozilla.com>
Fri, 09 May 2014 06:43:21 -0600
changeset 200419 322de1c5316c9b47c79273a94d1877867fee2055
parent 200418 4c2feb08ebbe613438dccf1b403b1cb11a6604b9
child 200420 96f3899ea1c34bd967c4d28c72600007191572dc
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, test-only
bugs1004668
milestone31.0a2
Bug 1004668 - Update robocop testUITelemetry. r=rnewman, a=test-only
mobile/android/base/tests/robocop.ini
mobile/android/base/tests/testUITelemetry.js
--- a/mobile/android/base/tests/robocop.ini
+++ b/mobile/android/base/tests/robocop.ini
@@ -111,18 +111,16 @@ skip-if = android_version == "10"
 [testBrowserDiscovery]
 [testDeviceSearchEngine]
 [testJNI]
 # [testMozPay] # see bug 945675
 [testOrderedBroadcast]
 [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
 #[testPan]
 #[testCheck]
 #[testCheck2]
 #[testBrowserProviderPerf]
 
--- a/mobile/android/base/tests/testUITelemetry.js
+++ b/mobile/android/base/tests/testUITelemetry.js
@@ -43,44 +43,45 @@ add_test(function test_telemetry_events(
   let measurements = obs.getUIMeasurements().filter(function(m) {
     // Only want events and sessions that were generated by
     // the Java-side of the test.
     return TEST_REGEX.test(m.type == "event" ? m.action : m.name);
   });
 
   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],
   ];
 
   do_check_eq(expected.length, measurements.length);
 
   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;
     }
   }
 
   run_next_test();
 });
 
 run_next_test();