inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType,
       new CompileTemplateMetadata({encapsulation: null, styles: [], styleUrls: []}),
       '<style>a</style>', 'package:some/module/');
   expect(template.styles).toEqual(['a']);
 }));
 (async: AsyncTestCompleter, normalizer: DirectiveNormalizer, xhr: SpyXHR) => {
   programXhrSpy(xhr, {
     'package:some/module/test.css': 'a@import "test2.css"',
     'package:some/module/test2.css': 'b'
   });
   normalizer
       .normalizeExternalStylesheets(new CompileTemplateMetadata({
         template: '',
         templateUrl: '',
         styleUrls: ['package:some/module/test.css']
       }))
       .then((template: CompileTemplateMetadata) => {
         expect(template.externalStylesheets.length).toBe(2);
         expect(template.externalStylesheets[0]).toEqual(new CompileStylesheetMetadata({
           moduleUrl: 'package:some/module/test.css',
           styles: ['a'],
           styleUrls: ['package:some/module/test2.css']
         }));
         expect(template.externalStylesheets[1]).toEqual(new CompileStylesheetMetadata({
           moduleUrl: 'package:some/module/test2.css',
           styles: ['b'],
           styleUrls: []
         }));
         async.done();
       });
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType,
       new CompileTemplateMetadata({encapsulation: null, styles: [], styleUrls: []}),
       '<ng-content select="a"></ng-content>', 'package:some/module/');
   expect(template.ngContentSelectors).toEqual(['a']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType,
       new CompileTemplateMetadata({encapsulation: null, styles: [], styleUrls: []}),
       '<div ngNonBindable><style>div {color:red}</style></div>', 'package:some/module/');
   expect(template.styles).toEqual(['div {color:red}']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType, new CompileTemplateMetadata(
                    {encapsulation: ViewEncapsulation.Emulated, styles: [], styleUrls: []}),
       '', 'package:some/module/id');
   expect(template.encapsulation).toEqual(ViewEncapsulation.None);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType,
       new CompileTemplateMetadata({encapsulation: null, styles: [], styleUrls: []}),
       '<link href="http://some/external.css" rel="stylesheet">', 'package:some/module/');
   expect(template.styleUrls).toEqual([]);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType,
       new CompileTemplateMetadata({encapsulation: null, styles: [], styleUrls: []}),
       '<div><link rel="stylesheet" href="aUrl"></div>', 'package:some/module/');
   expect(template.styleUrls).toEqual(['package:some/module/aUrl']);
 }));
 (async: AsyncTestCompleter, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
   xhr.expect('package:some/module/cmp.html', 'a');
   var templateMeta = new CompileTemplateMetadata({
     templateUrl: 'cmp.html',
   });
   Promise
       .all([
         normalizer.normalizeTemplateAsync(dirType, templateMeta),
         normalizer.normalizeTemplateAsync(dirType, templateMeta)
       ])
       .then((templates: CompileTemplateMetadata[]) => {
         expect(templates[0].template).toEqual('a');
         expect(templates[1].template).toEqual('a');
         async.done();
       });
   xhr.flush();
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType, new CompileTemplateMetadata(
                    {encapsulation: null, styles: ['@import "test.css";'], styleUrls: []}),
       '', 'package:some/module/id');
   expect(template.styles).toEqual(['']);
   expect(template.styleUrls).toEqual(['package:some/module/test.css']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirTypeWithHttpUrl, new CompileTemplateMetadata(
                               {encapsulation: null, styles: [], styleUrls: ['test.css']}),
       '', 'http://some/module/id');
   expect(template.styles).toEqual([]);
   expect(template.styleUrls).toEqual(['http://some/module/test.css']);
 }));