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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/logTest.sub.js

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests 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 // note, this template substitution is XSS, but no way to avoid it in this frame work
2 var expected_logs = {{GET[logs]}};
3 var timeout = "{{GET[timeout]}}";
4 if (timeout == "") {
5 timeout = 2;
6 }
7
8 if (expected_logs.length == 0) {
9 function log_assert(msg) {
10 test(function () { assert_unreached(msg) });
11 }
12 } else {
13 var t_log = async_test('Expecting logs: {{GET[logs]}}');
14 step_timeout(function() {
15 if(t_log.phase != t_log.phases.COMPLETE){
16 t_log.step(function () { assert_unreached('Logging timeout, expected log s ' + expected_logs + ' not sent.') });
17 t_log.done();
18 }
19 }, timeout * 1000);
20 function log(msg) {
21 //cons/**/ole.log(msg);
22 t_log.step(function () {
23 if (msg.match(/^FAIL/i)) {
24 assert_unreached(msg);
25 t_log.done();
26 }
27 for (var i = 0; i < expected_logs.length; i++) {
28 if (expected_logs[i] == msg) {
29 assert_true(expected_logs[i] == msg);
30 expected_logs.splice(i, 1);
31 if (expected_logs.length == 0) {
32 t_log.done();
33 }
34 return;
35 }
36 }
37 assert_unreached('unexpected log: ' + msg);
38 t_log.done();
39 });
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698