Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java

Issue 2124243002: Refactor the Java AppBannerManager to be owned by native code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.Context; 10 import android.content.Context;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 private String mWebAppUrl; 165 private String mWebAppUrl;
166 166
167 @Override 167 @Override
168 public void startMainActivity() throws InterruptedException { 168 public void startMainActivity() throws InterruptedException {
169 startMainActivityOnBlankPage(); 169 startMainActivityOnBlankPage();
170 } 170 }
171 171
172 @Override 172 @Override
173 protected void setUp() throws Exception { 173 protected void setUp() throws Exception {
174 mPackageManager = new TestPackageManager(); 174 mPackageManager = new TestPackageManager();
175 AppBannerManager.setIsEnabledForTesting(true); 175 AppBannerManager.setIsEnabled(true);
176 AppBannerInfoBarDelegateAndroid.setPackageManagerForTesting(mPackageMana ger); 176 AppBannerInfoBarDelegateAndroid.setPackageManagerForTesting(mPackageMana ger);
177 ShortcutHelper.setDelegateForTests(new ShortcutHelper.Delegate() { 177 ShortcutHelper.setDelegateForTests(new ShortcutHelper.Delegate() {
178 @Override 178 @Override
179 public void sendBroadcast(Context context, Intent intent) { 179 public void sendBroadcast(Context context, Intent intent) {
180 // Ignore to prevent adding homescreen shortcuts. 180 // Ignore to prevent adding homescreen shortcuts.
181 } 181 }
182 }); 182 });
183 183
184 super.setUp(); 184 super.setUp();
185 185
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 531 }
532 }); 532 });
533 533
534 // Test that bitmap sizes match expectations. 534 // Test that bitmap sizes match expectations.
535 int idealSize = getActivity().getResources().getDimensionPixelSize( 535 int idealSize = getActivity().getResources().getDimensionPixelSize(
536 R.dimen.webapp_splash_image_size_ideal); 536 R.dimen.webapp_splash_image_size_ideal);
537 assertEquals(idealSize, dataStorageFactory.mSplashImage.getWidth()); 537 assertEquals(idealSize, dataStorageFactory.mSplashImage.getWidth());
538 assertEquals(idealSize, dataStorageFactory.mSplashImage.getHeight()); 538 assertEquals(idealSize, dataStorageFactory.mSplashImage.getHeight());
539 } 539 }
540 } 540 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698