OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.history; | 5 package org.chromium.chrome.browser.history; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.app.Instrumentation; | 9 import android.app.Instrumentation; |
10 import android.app.Instrumentation.ActivityMonitor; | 10 import android.app.Instrumentation.ActivityMonitor; |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 } | 454 } |
455 }); | 455 }); |
456 CriteriaHelper.pollUiThread(new Criteria() { | 456 CriteriaHelper.pollUiThread(new Criteria() { |
457 @Override | 457 @Override |
458 public boolean isSatisfied() { | 458 public boolean isSatisfied() { |
459 return TextUtils.equals(mItem1.getUrl(), clipboardManager.getTex
t()); | 459 return TextUtils.equals(mItem1.getUrl(), clipboardManager.getTex
t()); |
460 } | 460 } |
461 }); | 461 }); |
462 | 462 |
463 // Check that the copy link item is not visible when more than one item
is selected. | 463 // Check that the copy link item is not visible when more than one item
is selected. |
| 464 toggleItemSelection(2); |
464 toggleItemSelection(3); | 465 toggleItemSelection(3); |
465 assertFalse(toolbar.getItemById(R.id.selection_mode_copy_link).isVisible
()); | 466 assertFalse(toolbar.getItemById(R.id.selection_mode_copy_link).isVisible
()); |
466 } | 467 } |
467 | 468 |
468 private void toggleItemSelection(int position) throws Exception { | 469 private void toggleItemSelection(int position) throws Exception { |
469 int callCount = mTestObserver.onSelectionCallback.getCallCount(); | 470 int callCount = mTestObserver.onSelectionCallback.getCallCount(); |
470 final SelectableItemView<HistoryItem> itemView = getItemView(position); | 471 final SelectableItemView<HistoryItem> itemView = getItemView(position); |
471 ThreadUtils.runOnUiThread(new Runnable() { | 472 ThreadUtils.runOnUiThread(new Runnable() { |
472 @Override | 473 @Override |
473 public void run() { | 474 public void run() { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 556 |
556 // Remove observer | 557 // Remove observer |
557 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 558 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
558 @Override | 559 @Override |
559 public void run() { | 560 public void run() { |
560 SigninManager.get(getActivity()).removeSignInStateObserver(mTest
Observer); | 561 SigninManager.get(getActivity()).removeSignInStateObserver(mTest
Observer); |
561 } | 562 } |
562 }); | 563 }); |
563 } | 564 } |
564 } | 565 } |
OLD | NEW |