OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.bookmarks; | 5 package org.chromium.chrome.browser.bookmarks; |
6 | 6 |
7 import android.support.test.filters.MediumTest; | 7 import android.support.test.filters.MediumTest; |
8 import android.support.test.filters.SmallTest; | 8 import android.support.test.filters.SmallTest; |
9 import android.support.v7.widget.RecyclerView; | 9 import android.support.v7.widget.RecyclerView; |
10 import android.support.v7.widget.RecyclerView.Adapter; | 10 import android.support.v7.widget.RecyclerView.Adapter; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 79 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
80 @Override | 80 @Override |
81 public void run() { | 81 public void run() { |
82 mBookmarkModel = new BookmarkModel(getActivity().getActivityTab(
).getProfile()); | 82 mBookmarkModel = new BookmarkModel(getActivity().getActivityTab(
).getProfile()); |
83 } | 83 } |
84 }); | 84 }); |
85 BookmarkTestUtil.waitForBookmarkModelLoaded(); | 85 BookmarkTestUtil.waitForBookmarkModelLoaded(); |
86 } | 86 } |
87 | 87 |
88 private void openBookmarkManager() throws InterruptedException { | 88 private void openBookmarkManager() throws InterruptedException { |
89 if (DeviceFormFactor.isTablet(getActivity())) { | 89 if (DeviceFormFactor.isTablet()) { |
90 loadUrl(UrlConstants.BOOKMARKS_URL); | 90 loadUrl(UrlConstants.BOOKMARKS_URL); |
91 mItemsContainer = (RecyclerView) getActivity().findViewById(R.id.rec
ycler_view); | 91 mItemsContainer = (RecyclerView) getActivity().findViewById(R.id.rec
ycler_view); |
92 } else { | 92 } else { |
93 // phone | 93 // phone |
94 BookmarkActivity activity = ActivityUtils.waitForActivity(getInstrum
entation(), | 94 BookmarkActivity activity = ActivityUtils.waitForActivity(getInstrum
entation(), |
95 BookmarkActivity.class, new MenuUtils.MenuActivityTrigger( | 95 BookmarkActivity.class, new MenuUtils.MenuActivityTrigger( |
96 getInstrumentation(), getActivity(), R.id.all_bookma
rks_menu_id)); | 96 getInstrumentation(), getActivity(), R.id.all_bookma
rks_menu_id)); |
97 mItemsContainer = (RecyclerView) activity.findViewById(R.id.recycler
_view); | 97 mItemsContainer = (RecyclerView) activity.findViewById(R.id.recycler
_view); |
98 } | 98 } |
99 } | 99 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 private void searchBookmarks(final String query) { | 332 private void searchBookmarks(final String query) { |
333 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 333 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
334 @Override | 334 @Override |
335 public void run() { | 335 public void run() { |
336 ((BookmarkItemsAdapter) mItemsContainer.getAdapter()).search(que
ry); | 336 ((BookmarkItemsAdapter) mItemsContainer.getAdapter()).search(que
ry); |
337 } | 337 } |
338 }); | 338 }); |
339 } | 339 } |
340 } | 340 } |
OLD | NEW |