xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/unsupported.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1{{header}}
2{{object 1 0}} <<
3  /Type /Catalog
4  /Pages 2 0 R
5  /OpenAction 10 0 R
6>>
7endobj
8{{object 2 0}} <<
9  /Type /Pages
10  /Count 1
11  /Kids [
12    3 0 R
13  ]
14>>
15endobj
16% Page number 0.
17{{object 3 0}} <<
18  /Type /Page
19  /Parent 2 0 R
20  /MediaBox [0 0 612 792]
21>>
22endobj
23% OpenAction action
24{{object 10 0}} <<
25  /Type /Action
26  /S /JavaScript
27  /JS 11 0 R
28>>
29endobj
30% JS program to execute
31{{object 11 0}} <<
32  {{streamlen}}
33>>
34stream
35function expectUnsupportedDangerousFeature(what) {
36  try {
37    var result = eval("typeof " + what);
38    if (result == "undefined") {
39      app.alert('PASS: ' + what + ' is not implemented');
40    } else {
41      app.alert('FAIL: ' + what + ' is implemented, probably a bad idea.');
42      app.alert('FAIL: see https://crbug.com/853237');
43    }
44  } catch (e) {
45    app.alert('Unexpected error ' + e.toString());
46  }
47}
48
49try {
50  expectUnsupportedDangerousFeature("ADBC");
51  expectUnsupportedDangerousFeature("Directory");
52  expectUnsupportedDangerousFeature("Net");
53  expectUnsupportedDangerousFeature("dbg");
54  expectUnsupportedDangerousFeature("security");
55} catch (e) {
56  app.alert('Truly unexpected error: ' + e);
57}
58endstream
59endobj
60{{xref}}
61{{trailer}}
62{{startxref}}
63%%EOF
64