2016-07-21 20:44:59 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {SecurityContext} from '@angular/core';
|
2017-03-02 15:12:46 -05:00
|
|
|
import * as t from '@angular/core/testing/src/testing_internal';
|
2016-07-21 20:44:59 -04:00
|
|
|
|
2016-08-25 18:41:19 -04:00
|
|
|
import {DomSanitizerImpl} from '../../src/security/dom_sanitization_service';
|
2016-07-21 20:44:59 -04:00
|
|
|
|
|
|
|
export function main() {
|
|
|
|
t.describe('DOM Sanitization Service', () => {
|
|
|
|
t.it('accepts resource URL values for resource contexts', () => {
|
2017-02-14 19:14:40 -05:00
|
|
|
const svc = new DomSanitizerImpl(null);
|
2016-07-21 20:44:59 -04:00
|
|
|
const resourceUrl = svc.bypassSecurityTrustResourceUrl('http://hello/world');
|
|
|
|
t.expect(svc.sanitize(SecurityContext.URL, resourceUrl)).toBe('http://hello/world');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|