2016-07-21 17:44:59 -07:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-07-21 17:44:59 -07:00
|
|
|
*
|
|
|
|
* 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';
|
2018-12-04 15:13:10 +01:00
|
|
|
import {DomSanitizerImpl} from '@angular/platform-browser/src/security/dom_sanitization_service';
|
2016-07-21 17:44:59 -07:00
|
|
|
|
2017-12-16 14:42:55 -08:00
|
|
|
{
|
2021-05-23 22:16:02 +02:00
|
|
|
describe('DOM Sanitization Service', () => {
|
|
|
|
it('accepts resource URL values for resource contexts', () => {
|
2017-02-14 16:14:40 -08:00
|
|
|
const svc = new DomSanitizerImpl(null);
|
2016-07-21 17:44:59 -07:00
|
|
|
const resourceUrl = svc.bypassSecurityTrustResourceUrl('http://hello/world');
|
2021-05-23 22:16:02 +02:00
|
|
|
expect(svc.sanitize(SecurityContext.URL, resourceUrl)).toBe('http://hello/world');
|
2016-07-21 17:44:59 -07:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|