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.banners; | 5 package org.chromium.chrome.browser.banners; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.Instrumentation.ActivityMonitor; | 8 import android.app.Instrumentation.ActivityMonitor; |
9 import android.app.Instrumentation.ActivityResult; | 9 import android.app.Instrumentation.ActivityResult; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 @Override | 149 @Override |
150 public void run() { | 150 public void run() { |
151 AppBannerManager.setAppDetailsDelegate(mDetailsDelegate); | 151 AppBannerManager.setAppDetailsDelegate(mDetailsDelegate); |
152 } | 152 } |
153 }); | 153 }); |
154 | 154 |
155 AppBannerManager.disableSecureSchemeCheckForTesting(); | 155 AppBannerManager.disableSecureSchemeCheckForTesting(); |
156 | 156 |
157 // Navigations in this test are all of type ui::PAGE_TRANSITION_LINK, i.
e. indirect. | 157 // Navigations in this test are all of type ui::PAGE_TRANSITION_LINK, i.
e. indirect. |
158 // Force indirect navigations to be worth the same as direct for testing
. | 158 // Force indirect navigations to be worth the same as direct for testing
. |
159 AppBannerManager.forceEngagementWeightsForTesting(1, 1); | 159 AppBannerManager.setEngagementWeights(1, 1); |
160 } | 160 } |
161 | 161 |
162 private boolean waitUntilNoInfoBarsExist() throws Exception { | 162 private boolean waitUntilNoInfoBarsExist() throws Exception { |
163 return CriteriaHelper.pollForUIThreadCriteria(new Criteria() { | 163 return CriteriaHelper.pollForUIThreadCriteria(new Criteria() { |
164 @Override | 164 @Override |
165 public boolean isSatisfied() { | 165 public boolean isSatisfied() { |
166 InfoBarContainer container = getActivity().getActivityTab().getI
nfoBarContainer(); | 166 InfoBarContainer container = getActivity().getActivityTab().getI
nfoBarContainer(); |
167 return container.getInfoBars().size() == 0; | 167 return container.getInfoBars().size() == 0; |
168 } | 168 } |
169 }); | 169 }); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 @Override | 442 @Override |
443 public boolean isSatisfied() { | 443 public boolean isSatisfied() { |
444 AppBannerManager manager = | 444 AppBannerManager manager = |
445 getActivity().getActivityTab().getAppBannerManagerForTes
ting(); | 445 getActivity().getActivityTab().getAppBannerManagerForTes
ting(); |
446 return !manager.isFetcherActiveForTesting(); | 446 return !manager.isFetcherActiveForTesting(); |
447 } | 447 } |
448 })); | 448 })); |
449 assertTrue(waitUntilAppBannerInfoBarAppears(WEB_APP_TITLE)); | 449 assertTrue(waitUntilAppBannerInfoBarAppears(WEB_APP_TITLE)); |
450 } | 450 } |
451 } | 451 } |
OLD | NEW |