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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarContainerTest.java

Issue 2019533002: [Android] Fix crash when closing tab during infobar cancellation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test on mobile Created 4 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.infobar; 5 package org.chromium.chrome.browser.infobar;
6 6
7 import android.graphics.Rect; 7 import android.graphics.Rect;
8 import android.graphics.Region; 8 import android.graphics.Region;
9 import android.os.Environment; 9 import android.os.Environment;
10 import android.test.suitebuilder.annotation.MediumTest; 10 import android.test.suitebuilder.annotation.MediumTest;
(...skipping 28 matching lines...) Expand all
39 public final CallbackHelper dismissedCallback = new CallbackHelper(); 39 public final CallbackHelper dismissedCallback = new CallbackHelper();
40 public final CallbackHelper primaryButtonCallback = new CallbackHelper() ; 40 public final CallbackHelper primaryButtonCallback = new CallbackHelper() ;
41 public final CallbackHelper secondaryButtonCallback = new CallbackHelper (); 41 public final CallbackHelper secondaryButtonCallback = new CallbackHelper ();
42 42
43 @Override 43 @Override
44 public void onInfoBarDismissed() { 44 public void onInfoBarDismissed() {
45 dismissedCallback.notifyCalled(); 45 dismissedCallback.notifyCalled();
46 } 46 }
47 47
48 @Override 48 @Override
49 public void onInfoBarButtonClicked(boolean isPrimary) { 49 public boolean onInfoBarButtonClicked(boolean isPrimary) {
50 if (isPrimary) { 50 if (isPrimary) {
51 primaryButtonCallback.notifyCalled(); 51 primaryButtonCallback.notifyCalled();
52 } else { 52 } else {
53 secondaryButtonCallback.notifyCalled(); 53 secondaryButtonCallback.notifyCalled();
54 } 54 }
55 return false;
55 } 56 }
56 } 57 }
57 58
58 private InfoBarTestAnimationListener mListener; 59 private InfoBarTestAnimationListener mListener;
59 private EmbeddedTestServer mTestServer; 60 private EmbeddedTestServer mTestServer;
60 61
61 public InfoBarContainerTest() { 62 public InfoBarContainerTest() {
62 super(ChromeActivity.class); 63 super(ChromeActivity.class);
63 } 64 }
64 65
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Additional manual test that this is working: 357 // Additional manual test that this is working:
357 // - adb shell dumpsys SurfaceFlinger 358 // - adb shell dumpsys SurfaceFlinger
358 // - Observe that Clank's overlay size changes (or disappears if URLbar is also gone). 359 // - Observe that Clank's overlay size changes (or disappears if URLbar is also gone).
359 } 360 }
360 361
361 @Override 362 @Override
362 public void startMainActivity() throws InterruptedException { 363 public void startMainActivity() throws InterruptedException {
363 startMainActivityOnBlankPage(); 364 startMainActivityOnBlankPage();
364 } 365 }
365 } 366 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698