| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 // Check that the item's remove button visibilty is set correctly after
signing out. | 365 // Check that the item's remove button visibilty is set correctly after
signing out. |
| 366 assertEquals(View.INVISIBLE, item.findViewById(R.id.remove).getVisibilit
y()); | 366 assertEquals(View.INVISIBLE, item.findViewById(R.id.remove).getVisibilit
y()); |
| 367 toggleItemSelection(2); | 367 toggleItemSelection(2); |
| 368 assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEn
abled()); | 368 assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEn
abled()); |
| 369 assertEquals(View.VISIBLE, item.findViewById(R.id.remove).getVisibility(
)); | 369 assertEquals(View.VISIBLE, item.findViewById(R.id.remove).getVisibility(
)); |
| 370 } | 370 } |
| 371 | 371 |
| 372 @SmallTest | 372 @SmallTest |
| 373 public void testToolbarShadow() throws Exception { | 373 public void testToolbarShadow() throws Exception { |
| 374 View toolbarShadow = mHistoryManager.getToolbarShadowForTests(); | 374 View toolbarShadow = mHistoryManager.getSelectableListLayout().getToolba
rShadowForTests(); |
| 375 assertEquals(View.GONE, toolbarShadow.getVisibility()); | 375 assertEquals(View.GONE, toolbarShadow.getVisibility()); |
| 376 | 376 |
| 377 toggleItemSelection(2); | 377 toggleItemSelection(2); |
| 378 assertTrue(mHistoryManager.getSelectionDelegateForTests().isSelectionEna
bled()); | 378 assertTrue(mHistoryManager.getSelectionDelegateForTests().isSelectionEna
bled()); |
| 379 assertEquals(View.VISIBLE, toolbarShadow.getVisibility()); | 379 assertEquals(View.VISIBLE, toolbarShadow.getVisibility()); |
| 380 | 380 |
| 381 toggleItemSelection(2); | 381 toggleItemSelection(2); |
| 382 assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEn
abled()); | 382 assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEn
abled()); |
| 383 assertEquals(View.GONE, toolbarShadow.getVisibility()); | 383 assertEquals(View.GONE, toolbarShadow.getVisibility()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 @SmallTest | 386 @SmallTest |
| 387 public void testSearchView() throws Exception { | 387 public void testSearchView() throws Exception { |
| 388 final HistoryManagerToolbar toolbar = mHistoryManager.getToolbarForTests
(); | 388 final HistoryManagerToolbar toolbar = mHistoryManager.getToolbarForTests
(); |
| 389 View toolbarShadow = mHistoryManager.getToolbarShadowForTests(); | 389 View toolbarShadow = mHistoryManager.getSelectableListLayout().getToolba
rShadowForTests(); |
| 390 View toolbarSearchView = toolbar.getSearchViewForTests(); | 390 View toolbarSearchView = toolbar.getSearchViewForTests(); |
| 391 assertEquals(View.GONE, toolbarShadow.getVisibility()); | 391 assertEquals(View.GONE, toolbarShadow.getVisibility()); |
| 392 assertEquals(View.GONE, toolbarSearchView.getVisibility()); | 392 assertEquals(View.GONE, toolbarSearchView.getVisibility()); |
| 393 | 393 |
| 394 toggleItemSelection(2); | 394 toggleItemSelection(2); |
| 395 assertTrue(mHistoryManager.getSelectionDelegateForTests().isSelectionEna
bled()); | 395 assertTrue(mHistoryManager.getSelectionDelegateForTests().isSelectionEna
bled()); |
| 396 | 396 |
| 397 int callCount = mTestObserver.onSelectionCallback.getCallCount(); | 397 int callCount = mTestObserver.onSelectionCallback.getCallCount(); |
| 398 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 398 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 399 @Override | 399 @Override |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 556 |
| 557 // Remove observer | 557 // Remove observer |
| 558 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 558 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 559 @Override | 559 @Override |
| 560 public void run() { | 560 public void run() { |
| 561 SigninManager.get(getActivity()).removeSignInStateObserver(mTest
Observer); | 561 SigninManager.get(getActivity()).removeSignInStateObserver(mTest
Observer); |
| 562 } | 562 } |
| 563 }); | 563 }); |
| 564 } | 564 } |
| 565 } | 565 } |
| OLD | NEW |