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']);
 }));
 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: []}),
       '<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']);
 }));
 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: []}),
       '<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: 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']);
 }));
         inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {

           var viewEncapsulation = ViewEncapsulation.Native;
           var template = normalizer.normalizeLoadedTemplate(
               dirType, new CompileTemplateMetadata(
                            {encapsulation: viewEncapsulation, styles: [], styleUrls: []}),
               '', 'package:some/module/');
           expect(template.encapsulation).toBe(viewEncapsulation);
         }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(dirType, new CompileTemplateMetadata({
                                                       encapsulation: null,
                                                       styles: [],
                                                       styleUrls: [],
                                                       baseUrl: 'package:some/module/a.js'
                                                     }),
                                                     'a', 'package:some/module/');
   expect(template.template).toEqual('a')
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   var template = normalizer.normalizeLoadedTemplate(
       dirType, new CompileTemplateMetadata({
         encapsulation: null,
         styles: ['.foo{background-image: url(\'double.jpg\');'],
         styleUrls: []
       }),
       '', 'package:some/module/id');
   expect(template.styles).toEqual(['.foo{background-image: url(\'double.jpg\');']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         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) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: null,
         styles: [],
         styleUrls: []
       },
       'a', 'package:some/module/');
   expect(template.template).toEqual('a');
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: null,
         styles: [],
         styleUrls: []
       },
       '<ng-content select="a"></ng-content>', 'package:some/module/');
   expect(template.ngContentSelectors).toEqual(['a']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: null,
         styles: [],
         styleUrls: []
       },
       '<link href="http://some/external.css" rel="stylesheet">', 'package:some/module/');
   expect(template.styleUrls).toEqual([]);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: null,
         styles: [],
         styleUrls: []
       },
       '<div><link rel="stylesheet" href="aUrl"></div>', 'package:some/module/');
   expect(template.styleUrls).toEqual(['package:some/module/aUrl']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: null,
         styles: ['.foo{background-image: url(\'double.jpg\');'],
         styleUrls: []
       },
       '', 'package:some/module/id');
   expect(template.styles).toEqual(['.foo{background-image: url(\'double.jpg\');']);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         encapsulation: ViewEncapsulation.Emulated,
         styles: [],
         styleUrls: []
       },
       '', 'package:some/module/id');
   expect(template.encapsulation).toEqual(ViewEncapsulation.None);
 }));
 inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_MODULE_URL,
         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) => {
   const template = normalizer.normalizeLoadedTemplate(
       {
         componentType: SomeComp,
         moduleUrl: SOME_HTTP_MODULE_URL,
         encapsulation: null,
         styles: [],
         styleUrls: ['test.css']
       },
       '', 'http://some/module/id');
   expect(template.styles).toEqual([]);
   expect(template.styleUrls).toEqual(['http://some/module/test.css']);
 }));
         inject([DirectiveNormalizer], (normalizer: DirectiveNormalizer) => {

           const viewEncapsulation = ViewEncapsulation.Native;
           const template = normalizer.normalizeLoadedTemplate(
               {
                 componentType: SomeComp,
                 moduleUrl: SOME_MODULE_URL,
                 encapsulation: viewEncapsulation,
                 styles: [],
                 styleUrls: []
               },
               '', 'package:some/module/');
           expect(template.encapsulation).toBe(viewEncapsulation);
         }));