Bug 878929: Fix robocop testShareLink to pass in the ListView. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Fri, 07 Jun 2013 10:50:43 -0700
changeset 134569 9619f1a5d3c2e7da2c9a5226419dc6768f6c8f38
parent 134568 98539fbbbf390fd3c985abe8f26b6893abee47ce
child 134570 85af7479df1c5da42e2f4d9cbd2f238a29e9036f
push id29274
push usersramasubramanian@mozilla.com
push dateMon, 10 Jun 2013 21:53:39 +0000
treeherdermozilla-inbound@9619f1a5d3c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs878929
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 878929: Fix robocop testShareLink to pass in the ListView. [r=mfinkle]
mobile/android/base/menu/GeckoMenu.java
mobile/android/base/tests/testShareLink.java.in
--- a/mobile/android/base/menu/GeckoMenu.java
+++ b/mobile/android/base/menu/GeckoMenu.java
@@ -102,17 +102,17 @@ public class GeckoMenu extends ListView
 
     public GeckoMenu(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
 
         setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                                          LayoutParams.FILL_PARENT));
 
         // Attach an adapter.
-        mAdapter = new MenuItemsAdapter(context);
+        mAdapter = new MenuItemsAdapter();
         setAdapter(mAdapter);
         setOnItemClickListener(this);
 
         mItems = new ArrayList<GeckoMenuItem>();
         mActionItems = new HashMap<GeckoMenuItem, View>();
 
         mActionItemBarPresenter =  (DefaultActionItemBar) LayoutInflater.from(context).inflate(R.layout.menu_action_bar, null);
     }
@@ -477,17 +477,17 @@ public class GeckoMenu extends ListView
 
     // Adapter to bind menu items to the list.
     private class MenuItemsAdapter extends BaseAdapter {
         private static final int VIEW_TYPE_DEFAULT = 0;
         private static final int VIEW_TYPE_ACTION_MODE = 1;
 
         private List<GeckoMenuItem> mItems;
 
-        public MenuItemsAdapter(Context context) {
+        public MenuItemsAdapter() {
             mItems = new ArrayList<GeckoMenuItem>();
         }
 
         @Override
         public int getCount() {
             if (mItems == null)
                 return 0;
 
--- a/mobile/android/base/tests/testShareLink.java.in
+++ b/mobile/android/base/tests/testShareLink.java.in
@@ -152,17 +152,17 @@ public class testShareLink extends BaseT
         }
         return displayedOptions;
     }
 
     public ArrayList<String> getShareSubMenuOption() {
         ArrayList<String> displayedOptions = new ArrayList();
         ListView shareMenu = getDisplayedShareList();
         for (int i = 0; i < shareMenu.getAdapter().getCount();i++) {
-             View shareItem = shareMenu.getAdapter().getView(i, null, null);
+             View shareItem = shareMenu.getAdapter().getView(i, null, shareMenu);
              if (shareItem instanceof android.widget.TextView) {
                  displayedOptions.add(((android.widget.TextView)shareItem).getText().toString());
              }
         }
         return displayedOptions;
     }
 
     public ArrayList<String> getShareOptionsList() {