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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java

Issue 1426683005: [Contextual Search] Improve testing & add regressions tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
index e113bc1c371dd20d294ae42d255cdb6aea2a1ef6..6c1564bd74c1dd1a28ea9a2e95b759cbdf2ca5f2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
@@ -810,8 +810,6 @@ abstract class ContextualSearchPanelBase implements ContextualSearchPromoHost {
* @param reason The reason for a change in the panel's state.
*/
public void setPanelState(PanelState state, StateChangeReason reason) {
- mPanelState = state;
-
if (state == PanelState.CLOSED) {
mIsShowing = false;
onClosed(reason);
@@ -819,6 +817,12 @@ abstract class ContextualSearchPanelBase implements ContextualSearchPromoHost {
|| (state == PanelState.MAXIMIZED && !isFullscreenSizePanel())) {
showPromoViewAtYPosition(getPromoYPx());
}
+
+ // We should only set the state at the end of this method, in oder to make sure the
Donn Denman 2015/10/27 19:18:51 nit: typo at end, change "the" to "that".
pedro (no code reviews) 2015/10/29 22:05:28 Done.
+ // all callbacks will be fired before changing the state of the Panel. This prevents
+ // some flakiness on tests since they rely on changes of state to determine when a
+ // particular action has been completed.
+ mPanelState = state;
}
/**

Powered by Google App Engine
This is Rietveld 408576698