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

Issue 685788 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Add command-line flag to disable all blink features under origin trial

Project Member Reported by cha...@chromium.org, Jan 26 2017

Issue description

In crrev.com/2640823004, layout tests were added to verify that various interfaces are correctly exposed to JavaScript, when the features are enabled by origin trials.

In order to test correctly, virtual test suites were added, with a command-line to turn off the blink runtime flags for the features. This was needed as all experimental features are on by default in layout tests (i.e. override the effect of --enable-experimental-web-platform-features).

The virtual test suite uses a command-line that individually specifies each affected feature. That adds an integration/maintenance burden for feature authors that are using origin trials.

Ideally, there would a single command-line flag (e.g. --disable-blink-origin-trial-features), that would automatically turn off all affected features. The list of features can be generated from RuntimeEnabledFeatures.in.
 
As in crrev.com/2640823004, should confirm if both of the virtual test suites are needed ("stable" and "origin-trials-features-disabled"). The fact that the expectations are identical for both suites suggest otherwise.
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 23 2017

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

commit 0ac7dd29d6b7537444599db5342de36c8f5c6a69
Author: chasej <chasej@chromium.org>
Date: Thu Feb 23 18:16:17 2017

Cleanup virtual test suites for origin trials

Remove the 'stable' virtual suite for origin trials layout tests. This
was redundant, as it had the identical expectations as the 'disabled'
virtual suite.

Rename/change the 'disabled' virtual suite to be based strictly on
runtime flags.

BUG= 685788 

Review-Url: https://codereview.chromium.org/2705643002
Cr-Commit-Position: refs/heads/master@{#452552}

[modify] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/docs/origin_trials_integration.md
[modify] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/VirtualTestSuites
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/README.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/foreignfetch-origin-trial-interfaces-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/imagecapture-origin-trial-interfaces-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/imagecapture-origin-trial-interfaces-script-added-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/rootscroller-origin-trial-interfaces-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/rootscroller-origin-trial-interfaces-script-added-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/webusb-origin-trial-interfaces-expected.txt
[rename] https://crrev.com/0ac7dd29d6b7537444599db5342de36c8f5c6a69/third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/webusb-origin-trial-interfaces-script-added-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/README.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/foreignfetch-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/imagecapture-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/imagecapture-origin-trial-interfaces-script-added-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/rootscroller-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/rootscroller-origin-trial-interfaces-script-added-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/webusb-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/29f1aefe09e181a54a437ab6c2845db8d6463e9b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/origin_trials/webexposed/webusb-origin-trial-interfaces-script-added-expected.txt

Owner: aval...@chromium.org
Status: Assigned (was: Available)
Ideally, we can add a command-line switch without much effort, to simplify the maintenance of tests.

Considerations:
- Probably use code generation to map any command-line switch to features that are under origin trial
- The documentation should be updated as necessary (docs/origin_trials_integration.md)
Isn't --disable-features=OriginTrials sufficient to disable all origin trials?
Looking at TrialTokenValidator::RequestEnablesFeature (https://cs.chromium.org/chromium/src/content/common/origin_trials/trial_token_validator.cc?l=70) ut returns false if OriginTrials is disabled.

Am I misunderstanding the goal?
After chatting offline the purpose is clearer. We want a global flag that will disable all the runtime enabled features that can be enabled via origin trials. This is to allow tests to verify that origin trials is actually doing something and not that the feature happens to be enabled anyway.

My idea then is to add to the generated file gen/blink/platform/RuntimeEnabledFeatures.{h,cpp}
  static blink::RuntimeEnabledFeatures::SetOriginTrialFeaturesEnabled(bool)

and plumbing the flag --disable-all-origin-trial-controlled-features to set this to false.
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 14 2017

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

commit a240566472914a6dd87070f8ea16e16981e65a1f
Author: Alex Vallée <avallee@google.com>
Date: Fri Jul 14 01:51:27 2017

[OriginTrials] Allow RuntimeEnabledFeatures to be disabled as a block.

For testing, we want to validate that OriginTrials is actually the cause
of the feature being enabled, not that a feature might be enabled by
RuntimeEnabledFeatures (early out).

RuntimeEnabledFeatures::SetOriginTrialControlledFeaturesEnabled allows
you to turn off all the features that can be turned on by OriginTrials.

BUG= 685788 

Change-Id: I7d18673db24b5b90d139b171e3094b66566b693c
Reviewed-on: https://chromium-review.googlesource.com/568368
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Jason Chase <chasej@chromium.org>
Commit-Queue: Alex Vallee <avallee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486621}
[modify] https://crrev.com/a240566472914a6dd87070f8ea16e16981e65a1f/third_party/WebKit/Source/build/scripts/make_runtime_features.py
[modify] https://crrev.com/a240566472914a6dd87070f8ea16e16981e65a1f/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
[modify] https://crrev.com/a240566472914a6dd87070f8ea16e16981e65a1f/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 15 2017

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

commit 640aa39844d3f15f8d274f7d9b13a6175d1f1c38
Author: Alex Vallée <avallee@google.com>
Date: Sat Jul 15 02:02:14 2017

[OriginTrials] Plumb command-line flag to disable features.

Added --disable-all-origin-trial-controlled-features which will turn off
all RuntimeEnabledFeatures that can be enabled by OT. These features can
then only be enabled with a valid trial token.

Bug:  685788 
Change-Id: Ic5e3976fe51482794107ca82c32412f2b47aee8c
Reviewed-on: https://chromium-review.googlesource.com/568807
Commit-Queue: Alex Vallee <avallee@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Jason Chase <chasej@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486964}
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/content/child/runtime_features.cc
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/content/public/common/content_switches.cc
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/content/public/common/content_switches.h
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/third_party/WebKit/LayoutTests/VirtualTestSuites
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp
[modify] https://crrev.com/640aa39844d3f15f8d274f7d9b13a6175d1f1c38/third_party/WebKit/public/platform/WebRuntimeFeatures.h

Status: Fixed (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 20 2017

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

commit a94fcfb2cbb571f1fe9367a800e538906a31523f
Author: Ian Clelland <iclelland@google.com>
Date: Thu Jul 20 03:43:48 2017

Update Origin Trials integration docs.

Two changes have landed recently which need to be reflected in
documentation for origin trials:

- Trials are disabled automatically in the virtual test suite, and do
    not have to be named explicitly in VirtualTestSuites.
- V8 bindings code is now generated automatically

This documentation change brings the developer docs up to date with reality.

BUG= 685788 ,  615060 

Change-Id: Icec69074b654bc749d790136de4e3a72855e3660
Reviewed-on: https://chromium-review.googlesource.com/578171
Reviewed-by: Jason Chase <chasej@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488127}
[modify] https://crrev.com/a94fcfb2cbb571f1fe9367a800e538906a31523f/docs/origin_trials_integration.md

Sign in to add a comment