Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Changes the tpl to output goog.modules.
Browse files Browse the repository at this point in the history
RELNOTES: Changes the tpl to output goog.modules.

PiperOrigin-RevId: 500698187
Change-Id: I19617466b64318fe680052cd95be27d669d79be7
  • Loading branch information
Closure Team authored and copybara-github committed Jan 9, 2023
1 parent fcafa66 commit 01cac58
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions closure/goog/html/safeurl_test_vectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
// AUTOGENERATED. DO NOT EDIT.
// clang-format off

goog.provide('goog.html.safeUrlTestVectors');
goog.module('goog.html.safeUrlTestVectors');
goog.setTestOnly('goog.html.safeUrlTestVectors');

goog.html.safeUrlTestVectors.BASE_VECTORS = [
/** @typedef {{input: string, expected: string, safe: boolean }} */
let TestVector;

/** @const {!Array<!TestVector>} */
const BASE_VECTORS = [
{input: '', expected: '', safe: true},
{input: 'http://example.com/', expected: 'http://example.com/', safe: true},
{input: 'https://example.com', expected: 'https://example.com', safe: true},
Expand Down Expand Up @@ -71,7 +75,8 @@ goog.html.safeUrlTestVectors.BASE_VECTORS = [
{input: 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D', expected: 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D', safe: true}
];

goog.html.safeUrlTestVectors.TEL_VECTORS = [
/** @const {!Array<!TestVector>} */
const TEL_VECTORS = [
{input: 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29', expected: 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29', safe: true},
{input: 'tEL:123;randmomparam\u003D123', expected: 'tEL:123;randmomparam\u003D123', safe: true},
{input: ':', expected: 'about:invalid#zClosurez', safe: false},
Expand All @@ -82,18 +87,22 @@ goog.html.safeUrlTestVectors.TEL_VECTORS = [
{input: 'tel:+1234567890', expected: 'tel:+1234567890', safe: true}
];

goog.html.safeUrlTestVectors.SMS_VECTORS = [
/** @const {!Array<!TestVector>} */
const SMS_VECTORS = [
{input: 'sms:+1234567890', expected: 'sms:+1234567890', safe: true},
{input: 'sms:?body\u003Dmessage', expected: 'sms:?body\u003Dmessage', safe: true},
{input: 'sms:?body\u003DHello, World!', expected: 'about:invalid#zClosurez', safe: false},
{input: 'sms:?body\u003Da\u0026body\u003Db', expected: 'about:invalid#zClosurez', safe: false}
];

goog.html.safeUrlTestVectors.SSH_VECTORS = [
/** @const {!Array<!TestVector>} */
const SSH_VECTORS = [
{input: 'ssh://cloud.google.com', expected: 'ssh://cloud.google.com', safe: true},
{input: '', expected: 'about:invalid#zClosurez', safe: false},
{input: ':', expected: 'about:invalid#zClosurez', safe: false},
{input: 'ssh:cloud.google.com', expected: 'about:invalid#zClosurez', safe: false},
{input: ' ssh://cloud.google.com', expected: 'about:invalid#zClosurez', safe: false},
{input: 'javascript:evil()', expected: 'about:invalid#zClosurez', safe: false}
];

exports = {BASE_VECTORS, TEL_VECTORS, SMS_VECTORS, SSH_VECTORS};

0 comments on commit 01cac58

Please sign in to comment.