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

Issue 1426683005: [Contextual Search] Improve testing & add regressions tests (Closed)

Created:
5 years, 1 month ago by pedro (no code reviews)
Modified:
5 years, 1 month ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Contextual Search] Improve testing & add regressions tests This CL adds tests for regressions that have been fixed recently, some of them involving ContentViewCore. In order to be able to properly instrument the ContentViewCore, changes in the testing framework have been made. There are now a couple of wrapper classes: OverlayPanelContentWrapper and ContentViewCoreWrapper, which allow us to test for example if the onShow() method was ever called, or if URLs have been properly removed from local history when not seen. This CL also introduces a few more helpers to simulate searches caused by gestures (long press and tap) in a way that it encapsulates the simulation logic and prevent flakiness. We were manually doing a search term resolution by calling a fakeResponse() method. Sometimes we are calling this when not necessary (on long press) and tests don't call it in the same order. We are also assuming it completed when the Bar peeks (which works but under the wrong assumption). There are now simulateLongPressSearch(id) and simulateTapSearch(id) methods that simulate the search and handle the resolution automatically when the system requests one. There are several helper methods in ContextualSearchManagerTest that are similar but do slightly different things, and some assumptions are not quite correct which can and may be causing falkiness in some tests. A couple of examples are: tests rely on the change of state of the Panel in order to determine that animations/actions are done. The closed state was being changed before destroying the Contents. This is now fixed. Another example is the tapBasePageToClosePanel() helper method that wasn't properly working when the Panel was peeking while a long press selection is present. I believe this is the cause of the flakiness of 3 of our tests. The new search simulation method should help making our tests more robust and a followup CL is required to change existing tests to use the new methods, once it has been confirmed that the new methods work properly on existing test bots. BUG=543319 Committed: https://crrev.com/7e0c3b88ed5970327b2aa7962a1bc336b71bc427 Cr-Commit-Position: refs/heads/master@{#357143}

Patch Set 1 #

Total comments: 52

Patch Set 2 : Addressed Donn's comments #

Total comments: 2

Patch Set 3 : Addressed Donn's comments & fixed test #

Total comments: 3

Patch Set 4 : Sync & rebase #

Messages

Total messages: 26 (7 generated)
pedro (no code reviews)
donnd@ and aurimas@: please take a look at this entire CL. dtrainor@: please take a ...
5 years, 1 month ago (2015-10-26 23:49:58 UTC) #3
pedro (no code reviews)
Oops, added the right dtrainor@ now.
5 years, 1 month ago (2015-10-26 23:50:25 UTC) #5
pedro (no code reviews)
Oops, added the right dtrainor@ now.
5 years, 1 month ago (2015-10-26 23:50:26 UTC) #6
Lei Zhang
You don't need me. chrome/test/data/OWNERS contains '*'
5 years, 1 month ago (2015-10-26 23:53:58 UTC) #7
Donn Denman
Pedro, thanks so much for starting this cleanup of our instrumentation tests! This was clearly ...
5 years, 1 month ago (2015-10-27 19:18:52 UTC) #8
pedro (no code reviews)
PTAL https://codereview.chromium.org/1426683005/diff/1/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java (right): https://codereview.chromium.org/1426683005/diff/1/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java#newcode821 chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java:821: // We should only set the state at ...
5 years, 1 month ago (2015-10-29 22:05:29 UTC) #9
Donn Denman
LGTM, thanks again for the cleanup! P.S. I wondered about the ever shown, but didn't ...
5 years, 1 month ago (2015-10-29 22:36:13 UTC) #10
pedro (no code reviews)
aurimas@, please take a look. dtrainor@, please review changes in OverlayPanelContent.java https://codereview.chromium.org/1426683005/diff/20001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): ...
5 years, 1 month ago (2015-10-29 23:07:28 UTC) #11
aurimas (slooooooooow)
lgtm https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode340 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:340: private void assertContentViewCoreCreated() { I don't really like ...
5 years, 1 month ago (2015-10-29 23:16:06 UTC) #12
pedro (no code reviews)
aurimas@, see my comment. https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode340 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:340: private void assertContentViewCoreCreated() { On ...
5 years, 1 month ago (2015-10-30 01:23:28 UTC) #13
Lei Zhang
On 2015/10/26 23:49:58, pedrosimonetti wrote: > mailto:thestig@chromium.org: please take a look at changes in tap_test.html ...
5 years, 1 month ago (2015-10-30 05:35:54 UTC) #14
pedro (no code reviews)
On 2015/10/30 05:35:54, Lei Zhang wrote: > On 2015/10/26 23:49:58, pedrosimonetti wrote: > > mailto:thestig@chromium.org: ...
5 years, 1 month ago (2015-10-30 17:29:35 UTC) #16
aurimas (slooooooooow)
https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1426683005/diff/30006/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode340 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:340: private void assertContentViewCoreCreated() { On 2015/10/30 at 01:23:28, pedrosimonetti ...
5 years, 1 month ago (2015-10-30 17:34:16 UTC) #17
gone
lgtm for //chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java
5 years, 1 month ago (2015-10-30 17:57:12 UTC) #19
pedro (no code reviews)
dtrainor@: I handed this over to dfalcantara@ since I only needed stamp on one file. ...
5 years, 1 month ago (2015-10-30 18:01:06 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1426683005/50001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1426683005/50001
5 years, 1 month ago (2015-10-30 18:06:55 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:50001)
5 years, 1 month ago (2015-10-30 18:39:05 UTC) #24
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/7e0c3b88ed5970327b2aa7962a1bc336b71bc427 Cr-Commit-Position: refs/heads/master@{#357143}
5 years, 1 month ago (2015-10-30 18:39:50 UTC) #25
jam
5 years, 1 month ago (2015-10-31 18:22:27 UTC) #26
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:50001) has been created in
https://codereview.chromium.org/1413383007/ by jam@chromium.org.

The reason for reverting is: Adds a very flaky test.

BUG=549805.

Powered by Google App Engine
This is Rietveld 408576698