@@ -27,11 +27,14 @@ import {TEST_PROVIDERS} from './test_bindings';
2727export function main ( ) {
2828 describe ( 'TemplateNormalizer' , ( ) => {
2929 var dirType : CompileTypeMetadata ;
30+ var dirTypeWithHttpUrl : CompileTypeMetadata ;
3031
3132 beforeEachBindings ( ( ) => TEST_PROVIDERS ) ;
3233
3334 beforeEach ( ( ) => {
3435 dirType = new CompileTypeMetadata ( { moduleUrl : 'package:some/module/a.js' , name : 'SomeComp' } ) ;
36+ dirTypeWithHttpUrl =
37+ new CompileTypeMetadata ( { moduleUrl : 'http://some/module/a.js' , name : 'SomeComp' } ) ;
3538 } ) ;
3639
3740 describe ( 'loadTemplate' , ( ) => {
@@ -284,6 +287,16 @@ export function main() {
284287 expect ( template . styleUrls ) . toEqual ( [ 'package:some/module/test.css' ] ) ;
285288 } ) ) ;
286289
290+ it ( 'should resolve relative style urls in styleUrls with http directive url' ,
291+ inject ( [ TemplateNormalizer ] , ( normalizer : TemplateNormalizer ) => {
292+ var template = normalizer . normalizeLoadedTemplate (
293+ dirTypeWithHttpUrl , new CompileTemplateMetadata (
294+ { encapsulation : null , styles : [ ] , styleUrls : [ 'test.css' ] } ) ,
295+ '' , 'http://some/module/id' ) ;
296+ expect ( template . styles ) . toEqual ( [ ] ) ;
297+ expect ( template . styleUrls ) . toEqual ( [ 'http://some/module/test.css' ] ) ;
298+ } ) ) ;
299+
287300 it ( 'should normalize ViewEncapsulation.Emulated to ViewEncapsulation.None if there are no stlyes nor stylesheets' ,
288301 inject ( [ TemplateNormalizer ] , ( normalizer : TemplateNormalizer ) => {
289302 var template = normalizer . normalizeLoadedTemplate (
0 commit comments