New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 754778 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Add annotations to set feature state in tests

Project Member Reported by dgn@chromium.org, Aug 11 2017

Issue description

Currently instrumentation tests rely on command line flags, but since they can't be repeated it has to be set at once. This means it's not possible to set feature if the feature flag has been used in the setup rule.

Unit tests have @Features, but to override the class-level ones one has to repeat all the flags, not only the one to modify.

Design doc: https://docs.google.com/document/d/13YIiVfV2razHabLxvB8pVlD9tOq1I6gEpquLdDFQLf4
 

Comment 1 by dgn@chromium.org, Aug 11 2017

Cc: aber...@chromium.org

Comment 3 by dgn@chromium.org, Sep 21 2017

Description: Show this description

Comment 4 by dgn@chromium.org, Sep 21 2017

Status: Started (was: Assigned)
🏡 Extract ChromeHome prefs setting for tests in dedicated rule

This is to allow enabling or disabling ChromeHome easily without
loading the whole of BottomSheet rule, which forces it to be
enabled for all the tests in the class

Bug: None
Change-Id: I17012186d10b765bea70f0bd89013f46accd1ac0
Reviewed-on: https://chromium-review.googlesource.com/674866
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503409}
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e2604b6509602fa52c44b0ecd64465942b9810d3

commit e2604b6509602fa52c44b0ecd64465942b9810d3
Author: Nicolas Dossou-gbete <dgn@chromium.org>
Date: Wed Nov 08 16:42:07 2017

🔬 Extend @Features support to instrumentation tests

Bug: 754778
Change-Id: I9bdf33e31dd1106de2ab383faa109d364ae01f13
Reviewed-on: https://chromium-review.googlesource.com/754936
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514856}
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/java_sources.gni
[add] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulatorTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/notifications/channels/ChannelDefinitionsTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderUnitTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/SuggestionsCarouselTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/test/android/BUILD.gn
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeHome.java
[modify] https://crrev.com/e2604b6509602fa52c44b0ecd64465942b9810d3/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/Features.java

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67a6d728918ef36565ddadb816ff8ebdf9d2dacb

commit 67a6d728918ef36565ddadb816ff8ebdf9d2dacb
Author: Nicolas Dossou-gbete <dgn@chromium.org>
Date: Fri Dec 01 02:07:55 2017

🔬 Add utility for processing annotations in tests

Introduces AnnotationProcessingUtils, which provides:
- AnnotationExtractor, a class allowing to retrieve one or many
annotations in reverse declaration order from a class or a test
description
- AnnotationProcessor, a rule to simplify the use of the above
extractor in the context of tests (here used as parent for @Features
rule).
- Utility methods to simplify the use of the above extractor in other
contexts (here used in SkipChecks)

Bug:  783160 ,754778
Change-Id: I8ca0793e1229c6268266c75791a44615b8f93f57
Reviewed-on: https://chromium-review.googlesource.com/789192
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520789}
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/BUILD.gn
[add] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessingUtils.java
[delete] https://crrev.com/d756c2dfa56141b3970cd836fb0a39d6872ca0e6/base/test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessor.java
[add] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/DisableIfSkipCheck.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheck.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java
[add] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/junit/src/org/chromium/base/test/util/AnnotationProcessingUtilsTest.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeHome.java
[modify] https://crrev.com/67a6d728918ef36565ddadb816ff8ebdf9d2dacb/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/Features.java

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6ef4e359eed63ac369c7f95edcb2d42d646f4fff

commit 6ef4e359eed63ac369c7f95edcb2d42d646f4fff
Author: Nicolas Dossou-gbete <dgn@chromium.org>
Date: Tue Dec 05 11:22:01 2017

🔬 Improve @ChromeHome usability in unit and instrumentation tests

- Introduces @ChromeHome.Enable and @ChromeHome.Disable
- @ChromeHome.Enable automatically causes the test test to be skipped
  when running on a tablet
- @ChromeHome now works for unit tests, ensures the cached state is
  reset between tests.

The plain @ChromeHome should eventually be removed in favour of the
dedicated annotations, that will happen in a subsequent cleanup patch.

Bug:  783160 ,754778
Change-Id: I60c69c2fb97a08aa1d0bcf533a8378cbbc1a548b
Reviewed-on: https://chromium-review.googlesource.com/796672
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521664}
[modify] https://crrev.com/6ef4e359eed63ac369c7f95edcb2d42d646f4fff/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java
[modify] https://crrev.com/6ef4e359eed63ac369c7f95edcb2d42d646f4fff/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
[modify] https://crrev.com/6ef4e359eed63ac369c7f95edcb2d42d646f4fff/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupUnitTest.java
[modify] https://crrev.com/6ef4e359eed63ac369c7f95edcb2d42d646f4fff/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeHome.java

Project Member

Comment 8 by bugdroid1@chromium.org, Jan 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8151cd61447eef9357070c11c92c5cd357631d9e

commit 8151cd61447eef9357070c11c92c5cd357631d9e
Author: Nicolas Dossou-gbete <dgn@chromium.org>
Date: Tue Jan 16 14:29:21 2018

🔬 Annotation test rules can decide to always apply

Add an option to AnnotationRule to let the rule apply even when it
did not collect any relevant annotation. This can let it react on
configuration defined programmatically (e.g. in setUp) rather than
by relying only on declared annotation.
This lets parameterized test use currently annotation-based rules
more easily.

Bug: 754778
Change-Id: I8a9c4ccffc6c1dc6a4b016bdbca2e596cc560c13
Reviewed-on: https://chromium-review.googlesource.com/866509
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529417}
[modify] https://crrev.com/8151cd61447eef9357070c11c92c5cd357631d9e/base/test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java
[modify] https://crrev.com/8151cd61447eef9357070c11c92c5cd357631d9e/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeHome.java

Comment 9 by dgn@chromium.org, Feb 26 2018

Cc: -bauerb@chromium.org
Owner: bauerb@chromium.org
Status: Assigned (was: Started)
Owner: ----
Status: Untriaged (was: Assigned)
Bulk edit: Moving back into the untriaged pool, as I'm leaving the project.

Sign in to add a comment