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, 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.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 // Do not access the target object(s) before adding the token. This is to test | |
iclelland
2017/01/20 14:31:19
The target object in this case is the value return
chasej
2017/01/25 19:58:20
Done.
| |
17 // the case where the target object(s) do not exist when the trial is enabled. | |
18 | |
19 // Add the token to enable the trial | |
iclelland
2017/01/20 14:31:19
We could factor this out into origin_trials.js, ma
chasej
2017/01/25 19:58:20
I factored this out into a function, but it's not
iclelland
2017/01/26 20:14:11
Yes, that's what I meant -- the DOM node to append
| |
20 var tokenElement = document.createElement('meta'); | |
21 tokenElement.httpEquiv = "origin-trial"; | |
22 tokenElement.content = token; | |
23 document.head.appendChild(tokenElement); | |
24 | |
25 // The trial is now enabled, by the token added via script. | |
26 expect_success(); | |
27 | |
28 </script> | |
OLD | NEW |