Bug 1317604 - 1a. Update testEventDispatcher to use Messaging.jsm; r=snorp
authorJim Chen <nchen@mozilla.com>
Mon, 21 Nov 2016 10:01:30 -0500
changeset 323706 946e15013499fe1bae4c1d8e910bacaf26638ade
parent 323705 22411be95565f743e9287f188d425f5108435a24
child 323707 c672332a484db01b65449af076039221c777c409
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewerssnorp
bugs1317604
milestone53.0a1
Bug 1317604 - 1a. Update testEventDispatcher to use Messaging.jsm; r=snorp testEventDispatcher used to use nsIAndroidEventDispatcher directly, either through nsIAndroidBridge or through a window's nsIAndroidView. Now that Messaging.jsm provides delegate objects for those interfaces, testEventDispatcher should use Messaging.jsm, so that we are testing Messaging.jsm as well.
mobile/android/tests/browser/robocop/testEventDispatcher.js
--- a/mobile/android/tests/browser/robocop/testEventDispatcher.js
+++ b/mobile/android/tests/browser/robocop/testEventDispatcher.js
@@ -43,23 +43,21 @@ function send_test_message(type) {
   let outerObject = get_test_message();
   outerObject.type = type;
 
   Messaging.sendRequest(outerObject);
 }
 
 function get_dispatcher(scope) {
   if (scope === 'global') {
-    return Services.androidBridge;
+    return EventDispatcher.instance;
   }
   if (scope === 'window') {
     let win = Services.wm.getMostRecentWindow("navigator:browser");
-    let view = win.arguments[0].QueryInterface(Components.interfaces.nsIAndroidView);
-    ok(view, "View object should exist in window arguments: " + view);
-    return view;
+    return EventDispatcher.for(win);
   }
   ok(false, "Invalid scope argument: " + scope);
 }
 
 function dispatch_test_message(scope, type) {
   let data = get_test_message();
   get_dispatcher(scope).dispatch(type, data);
 }