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

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

Issue 2673953003: Allow origin trials to be enabled by script (Closed)
Patch Set: 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, without t ouching the objects</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 // Do not access internals.OriginTrials() before adding the token. Can then test
18 // the case where the target object(s) do not exist when the trial is enabled.
19
20 // Add the token to enable the trial
21 OriginTrialsHelper.add_token(token);
22
23 // The trial is now enabled, by the token added via script.
24 expect_success();
25
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698