OLD | NEW |
---|---|
(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.js"></script> | |
7 <script> | |
8 | |
9 // TODO(iclelland): Generate this sample token during the build. The token | |
10 // below will expire in 2033, but it would be better to always have a token wh ich | |
11 // is guaranteed to be valid when the tests are run. --> | |
12 // Generate this token with the command: | |
13 // generate_token.py http://127.0.0.1:8000 Frobulate -expire-timestamp=200000000 0 | |
14 var token = "AlCoOPbezqtrGMzSzbLQC4c+oPqO6yuioemcBPjgcXajF8jtmZr4B8tJRPAARPbsX6h DeVyXCKHzEJfpBXvZgQEAAABReyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR 1cmUiOiAiRnJvYnVsYXRlIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9"; | |
15 | |
16 // The trial is not enabled, as no token is provided. | |
17 // - Skip the worker tests, as they will likely fail due to running after the | |
iclelland
2017/01/20 14:31:19
Can we chain these tests, so that the worker tests
chasej
2017/01/25 19:58:20
I looked into that, but wasn't able to find a simp
| |
18 // token is added below. | |
19 var skip_worker = true; | |
20 expect_failure(skip_worker); | |
21 | |
22 // Add the token to enable the trial | |
23 var tokenElement = document.createElement('meta'); | |
24 tokenElement.httpEquiv = "origin-trial"; | |
25 tokenElement.content = token; | |
26 document.head.appendChild(tokenElement); | |
27 | |
28 // The trial is now enabled, by the token added via script. | |
29 expect_success(); | |
30 | |
31 </script> | |
OLD | NEW |