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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added.html

Issue 2640823004: Allow origin trials to be enabled by script (Closed)
Patch Set: Address nit Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Test Sample API when trial is enabled by script-added meta tag</title>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="../resources/origin-trials-helper.js"></script>
7 <script src="resources/origin_trials.js"></script>
8 <script>
9
10 // TODO(iclelland): Generate this sample token during the build. The token
11 // below will expire in 2033, but it would be better to always have a token wh ich
12 // is guaranteed to be valid when the tests are run. -->
13 // Generate this token with the command:
14 // generate_token.py http://127.0.0.1:8000 Frobulate -expire-timestamp=200000000 0
15 var token = "AlCoOPbezqtrGMzSzbLQC4c+oPqO6yuioemcBPjgcXajF8jtmZr4B8tJRPAARPbsX6h DeVyXCKHzEJfpBXvZgQEAAABReyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR 1cmUiOiAiRnJvYnVsYXRlIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9";
16
17 // The trial is not enabled, as no token is provided.
18 // - Skip the worker tests, as they will likely fail due to running after the
19 // token is added below.
20 var skip_worker = true;
21 expect_failure(skip_worker);
22
23 // Add the token to enable the trial
24 OriginTrialsHelper.add_token(token);
25
26 // The trial is now enabled, by the token added via script.
27 expect_success();
28
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698