fix(testing): let DOM adapter dictate XHR implementation for tests

The test injector now uses an XHR implementation based on DOM.getXHR,
which allows the current DOM adapter to dictate which XHR impl should
be used.

To prevent the changes to DOM adapter from introducing undesired new
dependencies into the benchmarks, separate the async facade into
a promise facade which is reexported by facade/async.

See #4539
This commit is contained in:
Julie Ralph
2015-10-14 09:41:15 -07:00
parent 65c737fc95
commit d7ab5d44a5
12 changed files with 136 additions and 116 deletions

View File

@ -16,6 +16,8 @@ import {
import {Injectable, NgIf, bind} from 'angular2/core';
import {Directive, Component, View, ViewMetadata} from 'angular2/angular2';
import {XHR} from 'angular2/src/core/compiler/xhr';
import {XHRImpl} from 'angular2/src/core/compiler/xhr_impl';
// Services, and components for the tests.
@ -118,6 +120,9 @@ export function main() {
}, 0);
});
it('provides a real XHR instance',
inject([XHR], (xhr) => { expect(xhr).toBeAnInstanceOf(XHRImpl); }));
describe('setting up Providers', () => {
beforeEachProviders(() => [bind(FancyService).toValue(new FancyService())]);