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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/origin_trials/javascript-insert-token.html

Issue 1833063002: Store the list of trial tokens in OriginTrialContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 <!-- TODO(iclelland): Generate this sample token during the build. The token
iclelland 2016/03/31 15:00:00 The comment is still valid; should probably be in
4 below will expire in 2033, but it would be better to always have a token which
5 is guaranteed to be valid when the tests are run. -->
6 <script>
7 var meta = document.createElement('meta');
8 meta.setAttribute('http-equiv', 'origin-trial');
9 meta.setAttribute('content', '1|tZPW/JJ2Sxm4z7k/Eb1/upMsppozWpTwEuGwhgQko0zWS6eb vjQ+EXPP/ftoMX8/PCoDgOS3xlrXElMgDDvbCg==|http://127.0.0.1:8000|Frobulate|2000000 000');
10 document.head.appendChild(meta);
iclelland 2016/03/31 15:00:00 Can we define these four lines as a function here
Marijn Kruisselbrink 2016/04/01 23:54:47 Not done yet. I'm not sure if it really gains us m
iclelland 2016/04/05 17:26:28 I think we should share code -- definitely the opa
Marijn Kruisselbrink 2016/04/05 20:56:08 There are still multiple copies of the opaque toke
11 </script>
12 <title>Test Sample API when trial is enabled</title>
13 <script src="../resources/testharness.js"></script>
14 <script src="../resources/testharness-helpers.js"></script>
15 <script src="../resources/testharnessreport.js"></script>
16 <script src="resources/origin_trials.js"></script>
17 <script>
18
19 // The trial is not enabled by the token above, because it was inserted by
20 // javascript.
21 expect_failure();
22
23 var after_load_test = async_test("Testing async");
24 addEventListener('load', () => {
25 var meta = document.createElement('meta');
26 meta.setAttribute('http-equiv', 'origin-trial');
27 meta.setAttribute('content', '1|tZPW/JJ2Sxm4z7k/Eb1/upMsppozWpTwEuGwhgQko0zW S6ebvjQ+EXPP/ftoMX8/PCoDgOS3xlrXElMgDDvbCg==|http://127.0.0.1:8000|Frobulate|200 0000000');
28 document.head.appendChild(meta);
29 assert_idl_attribute(window.internals, 'frobulate');
iclelland 2016/03/31 15:00:00 Can this be replaced with a call to expect_failure
Marijn Kruisselbrink 2016/03/31 19:01:48 Not really. expect_failure() creates new tests rat
iclelland 2016/04/01 15:19:09 Maybe factoring the common code out into a named f
Marijn Kruisselbrink 2016/04/01 23:54:47 I changed expect_failure to optionally accept a te
30 assert_throws("NotSupportedError", () => { window.internals.frobulate; },
31 'Accessing attribute should throw error');
32 after_load_test.done();
33 });
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698