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

Issue 2812223004: Adding an origin trial for Budget API (Closed)

Created:
3 years, 8 months ago by harkness
Modified:
3 years, 5 months ago
CC:
chromium-reviews, iclelland+watch_chromuim.org, chasej+watch_chromium.org, haraken, blink-reviews-bindings_chromium.org, blink-reviews, kinuko+watch
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Adding an origin trial for Budget API The current plan for the Budget API in M59 is to release reserve() to stable, and experiment with getBudget and getCost. BUG=617971

Patch Set 1 #

Patch Set 2 : Merge branch 'master' into budget_experiment #

Patch Set 3 : Added expected values #

Patch Set 4 : Added expected values #

Patch Set 5 : Rebase #

Patch Set 6 : Fix rebase #

Patch Set 7 : Rebase #

Patch Set 8 : Fix expected output for virtual LayoutTests #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -10 lines) Patch
M third_party/WebKit/LayoutTests/VirtualTestSuites View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html View 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/budget/get-budget-expected.txt View 1 chunk +0 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces.html View 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html View 1 2 1 chunk +40 lines, -0 lines 4 comments Download
A third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-expected.txt View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker-expected.txt View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp View 1 2 3 4 3 chunks +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/budget/BudgetService.idl View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 35 (29 generated)
harkness
peter@ for Budget stuffs. iclelland@ for Origin trial integration.
3 years, 8 months ago (2017-04-21 08:28:22 UTC) #30
iclelland
On 2017/04/21 08:28:22, harkness wrote: > peter@ for Budget stuffs. > iclelland@ for Origin trial ...
3 years, 8 months ago (2017-04-21 15:47:33 UTC) #31
Peter Beverloo
https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html File third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html (right): https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html#newcode7 third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html:7: <meta http-equiv="origin-trial" content="AgFtR2Ps1Z9M/FW14Tgcwbajvq7kvzc/b1SPPSaaucG/P4ba6xC/69I9v8Pqx4wbsJINoqMabs9GE/LxOnPRfQIAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQnVkZ2V0UXVlcnkiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0" /> Ian, how does this work? ...
3 years, 8 months ago (2017-04-24 14:24:02 UTC) #32
iclelland
https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html File third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html (right): https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html#newcode7 third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-origin-trial-interfaces-in-service-worker.html:7: <meta http-equiv="origin-trial" content="AgFtR2Ps1Z9M/FW14Tgcwbajvq7kvzc/b1SPPSaaucG/P4ba6xC/69I9v8Pqx4wbsJINoqMabs9GE/LxOnPRfQIAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQnVkZ2V0UXVlcnkiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0" /> On 2017/04/24 14:24:01, Peter Beverloo ...
3 years, 8 months ago (2017-04-24 14:45:34 UTC) #33
Peter Beverloo
On Mon, Apr 24, 2017 at 3:45 PM, <iclelland@chromium.org> wrote: > > https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/ > LayoutTests/http/tests/origin_trials/webexposed/budget- ...
3 years, 8 months ago (2017-04-24 15:00:44 UTC) #34
Peter Beverloo
3 years, 8 months ago (2017-04-24 15:00:44 UTC) #35
On Mon, Apr 24, 2017 at 3:45 PM, <iclelland@chromium.org> wrote:

>
> https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/
> LayoutTests/http/tests/origin_trials/webexposed/budget-
> origin-trial-interfaces-in-service-worker.html
> File
> third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-
> origin-trial-interfaces-in-service-worker.html
> (right):
>
> https://codereview.chromium.org/2812223004/diff/140001/third_party/WebKit/
> LayoutTests/http/tests/origin_trials/webexposed/budget-
> origin-trial-interfaces-in-service-worker.html#newcode7
> third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/budget-
> origin-trial-interfaces-in-service-worker.html:7:
> <meta http-equiv="origin-trial"
> content="AgFtR2Ps1Z9M/FW14Tgcwbajvq7kvzc/b1SPPSaaucG/P4ba6xC/
> 69I9v8Pqx4wbsJINoqMabs9GE/LxOnPRfQIAAABTeyJvcmlnaW4iOiAi
> aHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQnVkZ2V0UXVl
> cnkiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0"
> />
> On 2017/04/24 14:24:01, Peter Beverloo wrote:
> > Ian, how does this work? The Service Worker will be started as its own
> context,
> > but more importantly, can be started without the document existing at
> all.
> >
> > a) Are we satisfied with the test coverage for this vs. the
> equivalent HTTP
> > header?
>
> If this test is passing, and it appears that the trial is enabled when
> it should not be, I would suggest that we shouldn't be satisfied with
> the test coverage :)
>
> The tests in LayoutTests/http/tests/origin_trials will *always* see the
> budget feature available, because the runtime flag for experimental
> features is turned on, I believe. The tests there are useful for
> ensuring that the properties are bound correctly, because Chrome still
> uses the origin trials mechanism to attach them to the JS objects.
>

Right, I see. That means that the new test isn't actually verifying Origin
Trials behaviour, it's verifying that marking features as experimental
works. That's unfortunate.

I guess what we want to test is where (1) the feature has not been enabled
because it's marked as experimental, but (2) the feature is enabled because
the OT token is passed. Which relates to your next paragraph...

Tests in LayoutTests/virtual/origin-trials-runtimeflags-disabled/ run
> with the runtime flag disabled, but you should still be able to turn the
> feature on with a trial token. The service worker tests should pass in
> this directory if we add the token as an HTTP header (see
> https://cs.chromium.org/chromium/src/third_party/
> WebKit/LayoutTests/http/tests/origin_trials/webexposed/
> resources/foreignfetch-origin-trial-interfaces-worker-enabled.php
> as an example)
>

Yes, this!

Jen, the important thing to do is to verify that the feature can be enabled
through OT in the origin-trials-runtimeflags-disabled virtual test suite.
The Foreign Fetch test Ian links to shows how to do that - run the Service
Worker test once w/ the header, and once without the header. In the
non-virtual test it should be available in both, in the virtual test only
when the header is provided. Some PHP will be needed for that.

> b) Do enabled origin trials always propagate to workers(/contexts)
> started
> > from a hosting document?
>
> Origin trials propagate to dedicated worker threads from the document
> which creates them, but not to shared workers or service workers. Those
> need to have the trial enabled by an HTTP header (we could probably add
> a JS interface, but have not done that yet for worker scripts). The
> token is cached with the service worker version, so that if the service
> worker is restarted without a network request, the token will still be
> enabled.
>

Ack, perfect!


>
>
>
> >
> > How would that work if two documents, one with the OT and one without,
> both
> > "start" the same shared/service worker?
>
> In both cases, the presence of the token in the HTTP response which
> delivers the worker script will determine whether the trial is enabled
> in that context.
>

Thanks,
Peter


>
> https://codereview.chromium.org/2812223004/
>

-- 
You received this message because you are subscribed to the Google Groups "Blink
Reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to blink-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698