| 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.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
| 6 | 6 |
| 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; | 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; |
| 8 import static org.chromium.content.browser.test.util.CriteriaHelper.DEFAULT_POLL
ING_INTERVAL; | 8 import static org.chromium.content.browser.test.util.CriteriaHelper.DEFAULT_POLL
ING_INTERVAL; |
| 9 | 9 |
| 10 import android.app.Activity; | 10 import android.app.Activity; |
| (...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 | 2686 |
| 2687 // The switch between the icon sprite and thumbnail is animated. Poll th
e UI thread to | 2687 // The switch between the icon sprite and thumbnail is animated. Poll th
e UI thread to |
| 2688 // check that the icon sprite is hidden at the end of the animation. | 2688 // check that the icon sprite is hidden at the end of the animation. |
| 2689 CriteriaHelper.pollUiThread(new Criteria() { | 2689 CriteriaHelper.pollUiThread(new Criteria() { |
| 2690 @Override | 2690 @Override |
| 2691 public boolean isSatisfied() { | 2691 public boolean isSatisfied() { |
| 2692 return !iconSpriteControl.isVisible(); | 2692 return !iconSpriteControl.isVisible(); |
| 2693 } | 2693 } |
| 2694 }); | 2694 }); |
| 2695 | 2695 |
| 2696 imageControl.hideThumbnail(false); | 2696 imageControl.hideStaticIcon(false); |
| 2697 | 2697 |
| 2698 assertTrue(iconSpriteControl.isVisible()); | 2698 assertTrue(iconSpriteControl.isVisible()); |
| 2699 assertFalse(imageControl.getThumbnailVisible()); | 2699 assertFalse(imageControl.getThumbnailVisible()); |
| 2700 assertTrue(TextUtils.isEmpty(imageControl.getThumbnailUrl())); | 2700 assertTrue(TextUtils.isEmpty(imageControl.getThumbnailUrl())); |
| 2701 } | 2701 } |
| 2702 | 2702 |
| 2703 // TODO(twellington): Add an end-to-end integration test for fetching a thum
bnail based on a | 2703 // TODO(twellington): Add an end-to-end integration test for fetching a thum
bnail based on a |
| 2704 // a URL that is included with the resolution response. | 2704 // a URL that is included with the resolution response. |
| 2705 | 2705 |
| 2706 /** | 2706 /** |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2720 // e.g. in case the Bar is about to show but has not yet appeared. Curr
ently catches ~90%. | 2720 // e.g. in case the Bar is about to show but has not yet appeared. Curr
ently catches ~90%. |
| 2721 assertPanelClosedOrUndefined(); | 2721 assertPanelClosedOrUndefined(); |
| 2722 | 2722 |
| 2723 // Similar sequence with network connected should peek for Longpress. | 2723 // Similar sequence with network connected should peek for Longpress. |
| 2724 setOnlineStatusAndReload(true); | 2724 setOnlineStatusAndReload(true); |
| 2725 longPressNodeWithoutWaiting("states"); | 2725 longPressNodeWithoutWaiting("states"); |
| 2726 waitForSelectActionBarVisible(); | 2726 waitForSelectActionBarVisible(); |
| 2727 waitForPanelToPeek(); | 2727 waitForPanelToPeek(); |
| 2728 } | 2728 } |
| 2729 } | 2729 } |
| OLD | NEW |