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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 /** | 42 /** |
43 * Tests the app banners. | 43 * Tests the app banners. |
44 */ | 44 */ |
45 @CommandLineFlags.Add(ChromeSwitches.ENABLE_APP_INSTALL_ALERTS) | 45 @CommandLineFlags.Add(ChromeSwitches.ENABLE_APP_INSTALL_ALERTS) |
46 public class AppBannerManagerTest extends ChromeTabbedActivityTestBase { | 46 public class AppBannerManagerTest extends ChromeTabbedActivityTestBase { |
47 private static final String NATIVE_APP_URL = | 47 private static final String NATIVE_APP_URL = |
48 TestHttpServerClient.getUrl("chrome/test/data/banners/play_app_test_
page.html"); | 48 TestHttpServerClient.getUrl("chrome/test/data/banners/play_app_test_
page.html"); |
49 | 49 |
50 private static final String NATIVE_ICON_URL = | 50 private static final String NATIVE_ICON_URL = |
51 TestHttpServerClient.getUrl("chrome/test/data/banners/launcher-icon-
1x.png"); | 51 TestHttpServerClient.getUrl("chrome/test/data/banners/launcher-icon-
4x.png"); |
52 | 52 |
53 private static final String NATIVE_APP_TITLE = "Mock app title"; | 53 private static final String NATIVE_APP_TITLE = "Mock app title"; |
54 | 54 |
55 private static final String NATIVE_APP_PACKAGE = "123456"; | 55 private static final String NATIVE_APP_PACKAGE = "123456"; |
56 | 56 |
57 private static final String NATIVE_APP_INSTALL_TEXT = "Install this"; | 57 private static final String NATIVE_APP_INSTALL_TEXT = "Install this"; |
58 | 58 |
59 private static final String NATIVE_APP_REFERRER = "chrome_inline"; | 59 private static final String NATIVE_APP_REFERRER = "chrome_inline"; |
60 | 60 |
61 private static final String NATIVE_APP_URL_WITH_MANIFEST_URL = | 61 private static final String NATIVE_APP_URL_WITH_MANIFEST_URL = |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 @Override | 440 @Override |
441 public boolean isSatisfied() { | 441 public boolean isSatisfied() { |
442 AppBannerManager manager = | 442 AppBannerManager manager = |
443 getActivity().getActivityTab().getAppBannerManagerForTes
ting(); | 443 getActivity().getActivityTab().getAppBannerManagerForTes
ting(); |
444 return !manager.isFetcherActiveForTesting(); | 444 return !manager.isFetcherActiveForTesting(); |
445 } | 445 } |
446 })); | 446 })); |
447 assertTrue(waitUntilAppBannerInfoBarAppears(WEB_APP_TITLE)); | 447 assertTrue(waitUntilAppBannerInfoBarAppears(WEB_APP_TITLE)); |
448 } | 448 } |
449 } | 449 } |
OLD | NEW |