2016-07-21 20:44:59 -04:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-07-21 20:44:59 -04: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';
|
2017-03-02 15:12:46 -05:00
|
|
|
import * as t from '@angular/core/testing/src/testing_internal';
|
2018-12-04 09:13:10 -05:00
|
|
|
import {DomSanitizerImpl} from '@angular/platform-browser/src/security/dom_sanitization_service';
|
2016-07-21 20:44:59 -04:00
|
|
|
|
2017-12-16 17:42:55 -05:00
|
|
|
{
|
2016-07-21 20:44:59 -04:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|