Backed out changeset 54fbf11caa18 (bug 1028004) to remove newline before commit message.
authorRichard Newman <rnewman@mozilla.com>
Sat, 21 Jun 2014 17:49:25 -0700
changeset 207213 f28dd1f782e8e9f6d2950fd039c2a400083800dd
parent 207212 54fbf11caa187c24acb7adfc757c989d50425832
child 207214 ed4d318958b1f8a39c431a4e76b45011344f538d
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1028004
milestone32.0a2
backs out54fbf11caa187c24acb7adfc757c989d50425832
Backed out changeset 54fbf11caa18 (bug 1028004) to remove newline before commit message.
mobile/android/base/tests/testUITelemetry.java
mobile/android/base/tests/testUITelemetry.js
widget/android/nsAppShell.cpp
--- a/mobile/android/base/tests/testUITelemetry.java
+++ b/mobile/android/base/tests/testUITelemetry.java
@@ -38,18 +38,17 @@ public class testUITelemetry extends Jav
             Telemetry.sendUIEvent(Event._TEST3, Method._TEST1, "foobarextras");
             Telemetry.stopUISession(Session._TEST_STARTED_TWICE, Reason._TEST1);
             Telemetry.sendUIEvent(Event._TEST4, Method._TEST1, "barextras");
             Telemetry.stopUISession(Session._TEST_STOPPED_TWICE, Reason._TEST2);
 
             // This session is already stopped, so this call should be ignored.
             Telemetry.stopUISession(Session._TEST_STOPPED_TWICE, Reason._TEST_IGNORED);
 
-            // Method defaults to Method.NONE
-            Telemetry.sendUIEvent(Event._TEST1);
+            Telemetry.sendUIEvent(Event._TEST1, Method._TEST1);
         } catch (Exception e) {
             Log.e("GeckoTest", "Oops.", e);
         }
 
         Log.i("GeckoTest", "Running remaining JS test code.");
         super.testJavascript();
     }
 }
--- a/mobile/android/base/tests/testUITelemetry.js
+++ b/mobile/android/base/tests/testUITelemetry.js
@@ -12,19 +12,16 @@ Cu.import("resource://gre/modules/Servic
 const EVENT_TEST1 = "_test_event_1.1";
 const EVENT_TEST2 = "_test_event_2.1";
 const EVENT_TEST3 = "_test_event_3.1";
 const EVENT_TEST4 = "_test_event_4.1";
 
 const METHOD_TEST1 = "_test_method_1";
 const METHOD_TEST2 = "_test_method_2";
 
-// Method.NONE is converted to an empty string after a few JSON stringifications
-const METHOD_NONE = "";
-
 const REASON_TEST1 = "_test_reason_1";
 const REASON_TEST2 = "_test_reason_2";
 
 const SESSION_STARTED_TWICE = "_test_session_started_twice.1";
 const SESSION_STOPPED_TWICE = "_test_session_stopped_twice.1";
 
 function do_check_array_eq(a1, a2) {
   do_check_eq(a1.length, a2.length);
@@ -81,35 +78,31 @@ add_test(function test_telemetry_events(
   let expected = expectedArraysToObjs([
     ["event",   EVENT_TEST1, METHOD_TEST1, [],                                             undefined],
     ["event",   EVENT_TEST2, METHOD_TEST1, [SESSION_STARTED_TWICE],                        undefined],
     ["event",   EVENT_TEST2, METHOD_TEST2, [SESSION_STARTED_TWICE],                        undefined],
     ["event",   EVENT_TEST3, METHOD_TEST1, [SESSION_STARTED_TWICE, SESSION_STOPPED_TWICE], "foobarextras"],
     ["session", SESSION_STARTED_TWICE, REASON_TEST1],
     ["event",   EVENT_TEST4, METHOD_TEST1, [SESSION_STOPPED_TWICE],                        "barextras"],
     ["session", SESSION_STOPPED_TWICE, REASON_TEST2],
-    ["event",   EVENT_TEST1, METHOD_NONE, [],                                              undefined],
+    ["event",   EVENT_TEST1, METHOD_TEST1, [],                                             undefined],
   ]);
 
   let obs = getObserver();
   let measurements = removeNonTestMeasurements(obs.getUIMeasurements());
 
   measurements.forEach(function (m, i) {
     if (m.type === "event") {
       m.sessions = removeNonTestSessions(m.sessions);
       m.sessions.sort(); // Mutates.
     }
 
     do_check_measurement_eq(expected[i], m);
   });
 
-  expected.forEach(function (m, i) {
-    do_check_measurement_eq(m, measurements[i]);
-  });
-
   run_next_test();
 });
 
 /**
  * Converts the expected value arrays to objects,
  * for less typing when initializing the expected arrays.
  */
 function expectedArraysToObjs(expectedArrays) {
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -417,17 +417,17 @@ nsAppShell::ProcessNextNativeEvent(bool 
         obs->StartSession(
                 nsString(curEvent->Characters()).get(),
                 curEvent->Time()
                 );
         break;
     }
 
     case AndroidGeckoEvent::TELEMETRY_UI_EVENT: {
-        if (curEvent->Data().Length() == 0)
+        if (curEvent->Characters().Length() == 0)
             break;
 
         nsCOMPtr<nsIUITelemetryObserver> obs;
         mBrowserApp->GetUITelemetryObserver(getter_AddRefs(obs));
         if (!obs)
             break;
 
         obs->AddEvent(