2016-04-12 12:40:37 -04:00
|
|
|
import {
|
|
|
|
beforeEach,
|
|
|
|
ddescribe,
|
|
|
|
describe,
|
|
|
|
expect,
|
|
|
|
iit,
|
|
|
|
inject,
|
|
|
|
it,
|
|
|
|
xdescribe,
|
|
|
|
xit
|
2016-04-28 20:50:03 -04:00
|
|
|
} from '@angular/core/testing/testing_internal';
|
|
|
|
import {IS_DART, RegExpWrapper, StringWrapper} from '../facade/src/lang';
|
2015-09-21 19:48:16 -04:00
|
|
|
import {getSymbolsFromLibrary} from './symbol_inspector/symbol_inspector';
|
2016-04-28 20:50:03 -04:00
|
|
|
import {ListWrapper} from '../facade/src/collection';
|
2015-09-14 23:49:29 -04:00
|
|
|
|
|
|
|
// =================================================================================================
|
|
|
|
// =================================================================================================
|
|
|
|
// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
|
|
|
|
// =================================================================================================
|
|
|
|
// =================================================================================================
|
|
|
|
//
|
|
|
|
// DO NOT EDIT THIS LIST OF PUBLIC APIS UNLESS YOU GET IT CLEARED BY: mhevery, vsavkin, or tbosch!
|
|
|
|
//
|
|
|
|
// =================================================================================================
|
|
|
|
// =================================================================================================
|
2016-05-13 04:07:17 -04:00
|
|
|
// Note that this test only tests for *values* exported (e.g. classes, functions, variables), but
|
|
|
|
// not for *types* exported (interfaces, typedefs).
|
|
|
|
// See tools/public_api_guard/public_api_spec.ts for a type based test.
|
|
|
|
// =================================================================================================
|
|
|
|
|
2015-09-14 23:49:29 -04:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var COMMON: string[] = [
|
|
|
|
'APP_BASE_HREF',
|
|
|
|
'HashLocationStrategy',
|
|
|
|
'Location',
|
|
|
|
'LocationStrategy',
|
|
|
|
'PathLocationStrategy',
|
|
|
|
'PlatformLocation',
|
2015-09-14 23:49:29 -04:00
|
|
|
'AbstractControl',
|
|
|
|
'AbstractControlDirective',
|
|
|
|
'AsyncPipe',
|
2015-11-02 19:03:42 -05:00
|
|
|
'COMMON_DIRECTIVES',
|
2015-12-10 20:21:51 -05:00
|
|
|
'COMMON_PIPES',
|
|
|
|
'CORE_DIRECTIVES',
|
2015-09-14 23:49:29 -04:00
|
|
|
'CheckboxControlValueAccessor',
|
|
|
|
'Control',
|
|
|
|
'ControlArray',
|
|
|
|
'ControlContainer',
|
|
|
|
'ControlGroup',
|
2015-12-10 20:21:51 -05:00
|
|
|
'ControlValueAccessor:dart',
|
2015-09-14 23:49:29 -04:00
|
|
|
'CurrencyPipe',
|
|
|
|
'DatePipe',
|
|
|
|
'DecimalPipe',
|
|
|
|
'DefaultValueAccessor',
|
|
|
|
'FORM_BINDINGS',
|
|
|
|
'FORM_DIRECTIVES',
|
2015-12-10 20:21:51 -05:00
|
|
|
'FORM_PROVIDERS',
|
|
|
|
'Form:dart',
|
2015-09-14 23:49:29 -04:00
|
|
|
'FormBuilder',
|
2016-02-26 13:02:52 -05:00
|
|
|
'I18nPluralPipe',
|
|
|
|
'I18nSelectPipe',
|
2015-09-14 23:49:29 -04:00
|
|
|
'JsonPipe',
|
|
|
|
'LowerCasePipe',
|
2015-12-10 20:21:51 -05:00
|
|
|
'MaxLengthValidator',
|
|
|
|
'MinLengthValidator',
|
|
|
|
'NG_ASYNC_VALIDATORS',
|
2015-09-14 23:49:29 -04:00
|
|
|
'NG_VALIDATORS',
|
2015-11-02 14:35:47 -05:00
|
|
|
'NG_VALUE_ACCESSOR',
|
2015-09-14 23:49:29 -04:00
|
|
|
'NgClass',
|
|
|
|
'NgControl',
|
|
|
|
'NgControlGroup',
|
|
|
|
'NgControlName',
|
2015-12-10 20:21:51 -05:00
|
|
|
'NgControlStatus',
|
2015-09-14 23:49:29 -04:00
|
|
|
'NgFor',
|
|
|
|
'NgForm',
|
|
|
|
'NgFormControl',
|
|
|
|
'NgFormModel',
|
|
|
|
'NgIf',
|
2016-04-11 11:47:28 -04:00
|
|
|
'NgTemplateOutlet',
|
2015-09-14 23:49:29 -04:00
|
|
|
'NgModel',
|
|
|
|
'NgSelectOption',
|
|
|
|
'NgStyle',
|
|
|
|
'NgSwitch',
|
|
|
|
'NgSwitchWhen',
|
2016-03-11 12:00:18 -05:00
|
|
|
'NgSwitchDefault',
|
2015-12-10 20:21:51 -05:00
|
|
|
'NumberPipe',
|
|
|
|
'ObservableListDiff:dart',
|
|
|
|
'ObservableListDiffFactory:dart',
|
2015-11-20 01:36:28 -05:00
|
|
|
'PatternValidator',
|
2015-12-10 20:21:51 -05:00
|
|
|
'PercentPipe',
|
2015-12-27 01:05:25 -05:00
|
|
|
'ReplacePipe',
|
2015-12-10 20:21:51 -05:00
|
|
|
'RequiredValidator',
|
|
|
|
'SelectControlValueAccessor',
|
|
|
|
'SlicePipe',
|
|
|
|
'UpperCasePipe',
|
|
|
|
'Validator:dart',
|
|
|
|
'Validators',
|
2016-02-05 19:08:53 -05:00
|
|
|
'RadioButtonState',
|
2016-03-11 12:00:18 -05:00
|
|
|
'NgLocalization',
|
|
|
|
'NgPlural',
|
|
|
|
'NgPluralCase'
|
2015-12-10 20:21:51 -05:00
|
|
|
];
|
|
|
|
|
2016-05-02 01:50:37 -04:00
|
|
|
var COMMON_TESTING: string[] = ['MockLocationStrategy', 'SpyLocation'];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
var COMPILER: string[] = [
|
|
|
|
'ElementSchemaRegistry',
|
|
|
|
'__compiler_private__',
|
2016-04-12 12:40:37 -04:00
|
|
|
"TemplateAst:dart",
|
|
|
|
"TemplateAstVisitor:dart",
|
|
|
|
"DEFAULT_PACKAGE_URL_PROVIDER",
|
|
|
|
"UrlResolver",
|
|
|
|
"AttrAst",
|
|
|
|
"BoundDirectivePropertyAst",
|
|
|
|
"BoundElementPropertyAst",
|
|
|
|
"BoundEventAst",
|
|
|
|
"BoundTextAst",
|
|
|
|
"COMPILER_PROVIDERS",
|
|
|
|
"CompileDirectiveMetadata",
|
|
|
|
"CompileTemplateMetadata",
|
|
|
|
"CompileTypeMetadata",
|
|
|
|
"DirectiveAst",
|
|
|
|
"ElementAst",
|
|
|
|
"EmbeddedTemplateAst",
|
|
|
|
"NgContentAst",
|
|
|
|
"PropertyBindingType",
|
|
|
|
"SourceModule",
|
|
|
|
"TEMPLATE_TRANSFORMS",
|
|
|
|
"TextAst",
|
|
|
|
"VariableAst",
|
2016-04-25 22:52:24 -04:00
|
|
|
"ReferenceAst",
|
2016-04-12 12:40:37 -04:00
|
|
|
"XHR",
|
2016-01-06 17:13:44 -05:00
|
|
|
"templateVisitAll",
|
|
|
|
"CompileDiDependencyMetadata",
|
|
|
|
"CompileFactoryMetadata",
|
|
|
|
"CompileIdentifierMetadata",
|
|
|
|
"CompileMetadataWithIdentifier",
|
|
|
|
"CompileMetadataWithType",
|
|
|
|
"CompilePipeMetadata",
|
|
|
|
"CompileProviderMetadata",
|
|
|
|
"CompileQueryMetadata",
|
|
|
|
"CompileTokenMetadata",
|
|
|
|
"CompilerConfig",
|
|
|
|
"RenderTypes",
|
|
|
|
"DirectiveResolver",
|
|
|
|
"NormalizedComponentWithViewDirectives",
|
|
|
|
"OfflineCompiler",
|
2016-05-04 13:45:48 -04:00
|
|
|
"RuntimeCompiler",
|
2016-01-06 17:13:44 -05:00
|
|
|
"PipeResolver",
|
|
|
|
"ProviderAst",
|
|
|
|
"ProviderAstType",
|
|
|
|
"ViewResolver",
|
|
|
|
"createOfflineCompileUrlResolver"
|
2015-12-10 20:21:51 -05:00
|
|
|
];
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var COMPILER_TESTING: string[] = [
|
|
|
|
'ComponentFixture',
|
|
|
|
'ComponentFixtureAutoDetect',
|
|
|
|
'ComponentFixtureNoNgZone',
|
|
|
|
'MockDirectiveResolver',
|
|
|
|
'MockSchemaRegistry',
|
|
|
|
'MockViewResolver',
|
|
|
|
'MockXHR',
|
|
|
|
'TestComponentBuilder',
|
|
|
|
'TestComponentRenderer'
|
|
|
|
];
|
|
|
|
|
2016-05-25 18:00:05 -04:00
|
|
|
// API Classification audited
|
2016-04-28 20:50:03 -04:00
|
|
|
var CORE: string[] = [
|
|
|
|
'__core_private__',
|
|
|
|
'BaseException',
|
|
|
|
'DefaultIterableDiffer',
|
|
|
|
'getDebugNode',
|
|
|
|
'wtfCreateScope',
|
|
|
|
'wtfEndTimeRange',
|
|
|
|
'wtfLeave',
|
|
|
|
'wtfStartTimeRange',
|
2016-04-12 12:40:37 -04:00
|
|
|
'APP_INITIALIZER',
|
|
|
|
'APP_ID',
|
|
|
|
'AbstractProviderError',
|
2016-05-25 15:46:22 -04:00
|
|
|
'AUTO_STYLE',
|
|
|
|
'AnimationAnimateMetadata',
|
|
|
|
'AnimationEntryMetadata',
|
|
|
|
'AnimationGroupMetadata',
|
|
|
|
'AnimationMetadata',
|
|
|
|
'AnimationSequenceMetadata',
|
|
|
|
'AnimationStateDeclarationMetadata',
|
|
|
|
'AnimationStateMetadata',
|
|
|
|
'AnimationStateTransitionMetadata',
|
|
|
|
'AnimationStyleMetadata',
|
|
|
|
'AnimationWithStepsMetadata',
|
|
|
|
'AnimationKeyframesSequenceMetadata',
|
|
|
|
'AnimationPlayer',
|
|
|
|
'animate',
|
|
|
|
'group',
|
|
|
|
'sequence',
|
|
|
|
'state',
|
|
|
|
'style',
|
|
|
|
'keyframes',
|
|
|
|
'trigger',
|
|
|
|
'transition',
|
2016-04-12 12:40:37 -04:00
|
|
|
'ApplicationRef',
|
|
|
|
'APPLICATION_COMMON_PROVIDERS',
|
|
|
|
'Attribute',
|
|
|
|
'AttributeMetadata',
|
|
|
|
'Binding',
|
|
|
|
'Provider',
|
|
|
|
'ProviderBuilder',
|
|
|
|
'PLATFORM_DIRECTIVES',
|
|
|
|
"CollectionChangeRecord",
|
|
|
|
'ChangeDetectionStrategy',
|
|
|
|
'ChangeDetectorRef',
|
2016-05-25 18:00:05 -04:00
|
|
|
'Class',
|
2016-04-13 20:05:17 -04:00
|
|
|
'ComponentResolver',
|
2016-05-04 13:45:48 -04:00
|
|
|
'SystemJsComponentResolver',
|
2016-04-12 12:40:37 -04:00
|
|
|
'Component',
|
|
|
|
'ComponentMetadata',
|
|
|
|
'ComponentRef',
|
|
|
|
'ContentChild',
|
|
|
|
'ContentChildMetadata',
|
|
|
|
'ContentChildren',
|
|
|
|
'ContentChildrenMetadata',
|
|
|
|
'CyclicDependencyError',
|
|
|
|
'PLATFORM_PIPES',
|
|
|
|
'DebugNode',
|
|
|
|
'DebugElement',
|
|
|
|
'Directive',
|
|
|
|
'DirectiveMetadata',
|
|
|
|
'DynamicComponentLoader',
|
|
|
|
'ElementRef',
|
|
|
|
'Output',
|
|
|
|
'EmbeddedViewRef',
|
|
|
|
'EventEmitter',
|
|
|
|
'ExceptionHandler',
|
|
|
|
'OutputMetadata',
|
|
|
|
'enableProdMode',
|
|
|
|
'ExpressionChangedAfterItHasBeenCheckedException',
|
|
|
|
'Host',
|
|
|
|
'HostBinding',
|
|
|
|
'HostBindingMetadata',
|
|
|
|
'HostListener',
|
|
|
|
'HostListenerMetadata',
|
|
|
|
'HostMetadata',
|
2016-04-13 20:05:17 -04:00
|
|
|
'ComponentFactory',
|
2016-04-12 12:40:37 -04:00
|
|
|
'Inject',
|
|
|
|
'InjectMetadata',
|
|
|
|
'Injectable',
|
|
|
|
'InjectableMetadata',
|
|
|
|
'Injector',
|
2016-04-14 15:35:24 -04:00
|
|
|
'ReflectiveInjector',
|
2016-04-12 12:40:37 -04:00
|
|
|
'InstantiationError',
|
|
|
|
'InvalidProviderError',
|
|
|
|
'IterableDiffers',
|
2016-04-14 15:35:24 -04:00
|
|
|
'ReflectiveKey',
|
2016-04-12 12:40:37 -04:00
|
|
|
'KeyValueChangeRecord',
|
|
|
|
'KeyValueDiffers',
|
|
|
|
'NgZone',
|
|
|
|
'NgZoneError',
|
|
|
|
'NoAnnotationError',
|
|
|
|
'NoProviderError',
|
|
|
|
'OpaqueToken',
|
|
|
|
'Optional',
|
|
|
|
'OptionalMetadata',
|
|
|
|
'OutOfBoundsError',
|
|
|
|
'Pipe',
|
|
|
|
'PipeMetadata',
|
|
|
|
'PlatformRef',
|
|
|
|
'Input',
|
|
|
|
'InputMetadata',
|
|
|
|
'Query',
|
|
|
|
'QueryList',
|
|
|
|
'QueryMetadata',
|
|
|
|
'Renderer',
|
|
|
|
'RootRenderer',
|
|
|
|
'RenderComponentType',
|
2016-04-14 15:35:24 -04:00
|
|
|
'ResolvedReflectiveFactory',
|
2016-04-12 12:40:37 -04:00
|
|
|
'Self',
|
|
|
|
'SelfMetadata',
|
|
|
|
'SkipSelf',
|
|
|
|
'SkipSelfMetadata',
|
|
|
|
'SimpleChange',
|
|
|
|
'TemplateRef',
|
|
|
|
'Testability',
|
|
|
|
'TestabilityRegistry',
|
|
|
|
'setTestabilityGetter',
|
|
|
|
'Type',
|
|
|
|
'PACKAGE_ROOT_URL',
|
|
|
|
'ViewChild',
|
|
|
|
'ViewChildMetadata',
|
|
|
|
'ViewChildren',
|
|
|
|
'ViewChildrenMetadata',
|
|
|
|
'ViewContainerRef',
|
|
|
|
'ViewEncapsulation',
|
|
|
|
'ViewMetadata',
|
|
|
|
'ViewQuery',
|
|
|
|
'ViewQueryMetadata',
|
|
|
|
'WrappedException',
|
|
|
|
'WrappedValue',
|
|
|
|
'asNativeElements',
|
|
|
|
'bind',
|
|
|
|
'provide',
|
|
|
|
'createNgZone',
|
2016-05-25 18:00:05 -04:00
|
|
|
'forwardRef',
|
2016-04-14 17:52:35 -04:00
|
|
|
'coreBootstrap',
|
|
|
|
'coreLoadAndBootstrap',
|
|
|
|
'createPlatform',
|
|
|
|
'disposePlatform',
|
|
|
|
'getPlatform',
|
|
|
|
'assertPlatform',
|
2016-05-25 18:00:05 -04:00
|
|
|
'resolveForwardRef',
|
2016-04-12 12:40:37 -04:00
|
|
|
'PLATFORM_COMMON_PROVIDERS',
|
|
|
|
'PLATFORM_INITIALIZER',
|
2016-05-04 13:00:59 -04:00
|
|
|
'AfterContentChecked',
|
|
|
|
'AfterContentInit',
|
|
|
|
'AfterViewChecked',
|
|
|
|
'AfterViewInit',
|
|
|
|
'DoCheck',
|
|
|
|
'OnChanges',
|
|
|
|
'OnDestroy',
|
|
|
|
'OnInit',
|
2016-04-12 12:40:37 -04:00
|
|
|
'ViewRef',
|
2015-12-10 20:21:51 -05:00
|
|
|
];
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var CORE_TESTING: string[] = [
|
|
|
|
'InjectSetupWrapper',
|
|
|
|
'Log',
|
|
|
|
'MockApplicationRef',
|
|
|
|
'MockNgZone',
|
|
|
|
'TestInjector',
|
|
|
|
'afterEach',
|
|
|
|
'async',
|
|
|
|
'beforeEach',
|
|
|
|
'beforeEachProviders',
|
|
|
|
'clearPendingTimers',
|
|
|
|
'containsRegexp',
|
|
|
|
'ddescribe',
|
|
|
|
'describe',
|
|
|
|
'expect',
|
|
|
|
'fakeAsync',
|
|
|
|
'fdescribe',
|
|
|
|
'fit',
|
|
|
|
'flushMicrotasks',
|
|
|
|
'getTestInjector',
|
|
|
|
'getTypeOf',
|
|
|
|
'iit',
|
|
|
|
'inject',
|
|
|
|
'injectAsync',
|
|
|
|
'instantiateType',
|
|
|
|
'it',
|
|
|
|
'resetBaseTestProviders',
|
|
|
|
'setBaseTestProviders',
|
|
|
|
'tick',
|
2016-05-26 13:19:30 -04:00
|
|
|
'discardPeriodicTasks',
|
2016-04-28 20:50:03 -04:00
|
|
|
'withProviders',
|
|
|
|
'xdescribe',
|
|
|
|
'xit'
|
|
|
|
];
|
2015-11-13 14:21:16 -05:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var PLATFORM_BROWSER: string[] = [
|
|
|
|
'__platform_browser_private__',
|
2016-05-19 17:31:21 -04:00
|
|
|
'AngularEntrypoint:dart',
|
|
|
|
'bootstrap',
|
|
|
|
'bootstrapApp',
|
|
|
|
'bootstrapRender',
|
|
|
|
'BROWSER_APP_PROVIDERS',
|
2016-05-20 19:11:49 -04:00
|
|
|
'BROWSER_APP_COMPILER_PROVIDERS',
|
2016-05-19 17:31:21 -04:00
|
|
|
'BROWSER_PLATFORM_PROVIDERS',
|
2016-05-24 19:13:17 -04:00
|
|
|
'BROWSER_PROVIDERS',
|
feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.
* `SecurityContext` is a private API between core, compiler, and
platform-browser. `SecurityContext` communicates what context a value is used
in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
determines the security context for an attribute or property (it turns out
attributes and properties match for the purposes of sanitization).
Based on these hooks:
* `DomSchemaElementRegistry` decides what sanitization applies in a particular
context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
Value*s, i.e. the ability to mark a value as safe and not requiring further
sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
(surprise!).
`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).
BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***
Reviewers: IgorMinar
Differential Revision: https://reviews.angular.io/D103
2016-04-29 19:04:08 -04:00
|
|
|
'BROWSER_SANITIZATION_PROVIDERS',
|
2016-04-14 17:52:35 -04:00
|
|
|
'browserPlatform',
|
2016-04-28 20:50:03 -04:00
|
|
|
'BrowserPlatformLocation',
|
|
|
|
'By',
|
2016-05-19 17:31:21 -04:00
|
|
|
'CACHED_TEMPLATE_PROVIDER',
|
2016-05-13 16:22:29 -04:00
|
|
|
'ClientMessageBroker',
|
|
|
|
'ClientMessageBrokerFactory',
|
2016-05-19 17:31:21 -04:00
|
|
|
'disableDebugTools',
|
|
|
|
'DOCUMENT',
|
|
|
|
'DomEventsPlugin',
|
|
|
|
'DomSanitizationService',
|
|
|
|
'ELEMENT_PROBE_PROVIDERS',
|
|
|
|
'enableDebugTools',
|
|
|
|
'EVENT_MANAGER_PLUGINS',
|
|
|
|
'EventManager',
|
2016-05-13 16:22:29 -04:00
|
|
|
'FnArg',
|
2016-05-19 17:31:21 -04:00
|
|
|
'HAMMER_GESTURE_CONFIG',
|
|
|
|
'HammerGestureConfig',
|
|
|
|
'initializeGenericWorkerRenderer',
|
|
|
|
'KeyEventsPlugin',
|
2016-05-13 16:22:29 -04:00
|
|
|
'MessageBus',
|
|
|
|
'PRIMITIVE',
|
|
|
|
'ReceivedMessage',
|
2016-05-19 17:31:21 -04:00
|
|
|
'SecurityContext',
|
2016-05-13 16:22:29 -04:00
|
|
|
'ServiceMessageBroker',
|
|
|
|
'ServiceMessageBrokerFactory',
|
2016-05-19 17:31:21 -04:00
|
|
|
'Title',
|
2016-05-13 16:22:29 -04:00
|
|
|
'UiArguments',
|
2016-05-19 17:31:21 -04:00
|
|
|
'UrlChangeEvent:dart',
|
|
|
|
'UrlChangeListener:dart',
|
|
|
|
'WebWorkerInstance',
|
2016-05-13 16:22:29 -04:00
|
|
|
'WORKER_APP_APPLICATION_PROVIDERS',
|
2016-05-19 17:31:21 -04:00
|
|
|
'WORKER_APP_LOCATION_PROVIDERS',
|
2016-05-13 16:22:29 -04:00
|
|
|
'WORKER_APP_PLATFORM_PROVIDERS',
|
2016-05-19 17:31:21 -04:00
|
|
|
'WORKER_RENDER_APPLICATION_PROVIDERS',
|
|
|
|
'WORKER_RENDER_LOCATION_PROVIDERS',
|
2016-05-13 16:22:29 -04:00
|
|
|
'WORKER_RENDER_PLATFORM_PROVIDERS',
|
|
|
|
'WORKER_RENDER_STARTABLE_MESSAGING_SERVICE',
|
|
|
|
'WORKER_SCRIPT',
|
|
|
|
'workerAppPlatform',
|
2016-05-19 17:31:21 -04:00
|
|
|
'workerRenderPlatform'
|
2015-09-21 19:48:16 -04:00
|
|
|
];
|
2015-09-14 23:49:29 -04:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var PLATFORM_BROWSER_TESTING: string[] = [
|
2016-05-02 01:50:37 -04:00
|
|
|
'ADDITIONAL_TEST_BROWSER_PROVIDERS', // This should be made private
|
2016-05-19 17:31:21 -04:00
|
|
|
'ADDITIONAL_TEST_BROWSER_STATIC_PROVIDERS', // This should be made private
|
2016-04-28 20:50:03 -04:00
|
|
|
'BrowserDetection',
|
|
|
|
'browserDetection',
|
|
|
|
'dispatchEvent',
|
2016-05-19 17:31:21 -04:00
|
|
|
'DOMTestComponentRenderer',
|
2016-04-28 20:50:03 -04:00
|
|
|
'el',
|
|
|
|
'expect',
|
|
|
|
'normalizeCSS',
|
2016-05-19 17:31:21 -04:00
|
|
|
'stringifyElement',
|
|
|
|
'TEST_BROWSER_APPLICATION_PROVIDERS',
|
|
|
|
'TEST_BROWSER_PLATFORM_PROVIDERS',
|
|
|
|
'TEST_BROWSER_STATIC_APPLICATION_PROVIDERS',
|
|
|
|
'TEST_BROWSER_STATIC_PLATFORM_PROVIDERS'
|
2016-05-13 16:22:29 -04:00
|
|
|
];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2016-05-02 01:50:37 -04:00
|
|
|
var PLATFORM_SERVER: string[] = ['Parse5DomAdapter'];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2016-05-02 01:50:37 -04:00
|
|
|
var PLATFORM_SERVER_TESTING: string[] =
|
|
|
|
['TEST_SERVER_APPLICATION_PROVIDERS', 'TEST_SERVER_PLATFORM_PROVIDERS'];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
var UPGRADE: string[] = [
|
2016-03-11 12:00:18 -05:00
|
|
|
'UpgradeAdapter',
|
|
|
|
'UpgradeAdapterRef',
|
2015-10-26 23:17:46 -04:00
|
|
|
];
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
var HTTP: string[] = [
|
|
|
|
'BaseRequestOptions',
|
|
|
|
'BaseResponseOptions',
|
|
|
|
'BrowserXhr',
|
|
|
|
'Connection',
|
|
|
|
'ConnectionBackend',
|
|
|
|
'HTTP_BINDINGS',
|
|
|
|
'HTTP_PROVIDERS',
|
|
|
|
'Headers',
|
|
|
|
'Http',
|
|
|
|
'JSONPBackend',
|
|
|
|
'JSONPConnection',
|
|
|
|
'JSONP_PROVIDERS',
|
|
|
|
'JSON_BINDINGS',
|
|
|
|
'Jsonp',
|
|
|
|
'ReadyState',
|
|
|
|
'Request',
|
|
|
|
'RequestMethod',
|
|
|
|
'RequestOptions',
|
|
|
|
'Response',
|
|
|
|
'ResponseOptions',
|
|
|
|
'ResponseType',
|
|
|
|
'URLSearchParams',
|
|
|
|
'XHRBackend',
|
|
|
|
'XHRConnection'
|
|
|
|
];
|
|
|
|
|
2016-05-02 01:50:37 -04:00
|
|
|
var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection'];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2016-05-02 13:36:58 -04:00
|
|
|
var ROUTER_DEPRECATED: string[] = [
|
2016-04-28 20:50:03 -04:00
|
|
|
'AsyncRoute',
|
|
|
|
'AuxRoute',
|
|
|
|
'CanActivate',
|
|
|
|
'ComponentInstruction',
|
|
|
|
'Instruction',
|
|
|
|
'OpaqueToken',
|
|
|
|
'ROUTER_BINDINGS',
|
|
|
|
'ROUTER_DIRECTIVES',
|
|
|
|
'ROUTER_PRIMARY_COMPONENT',
|
|
|
|
'ROUTER_PROVIDERS',
|
|
|
|
'ROUTER_PROVIDERS_COMMON',
|
|
|
|
'Redirect',
|
|
|
|
'Route',
|
|
|
|
'RouteConfig',
|
|
|
|
'RouteData',
|
|
|
|
'RouteParams',
|
|
|
|
'RouteRegistry',
|
|
|
|
'Router',
|
|
|
|
'RouterLink',
|
|
|
|
'RouterOutlet'
|
|
|
|
];
|
|
|
|
|
2016-05-26 12:52:56 -04:00
|
|
|
var ROUTER_DEPRECATED_TESTING: string[] = [];
|
2016-05-02 13:36:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
var ROUTER: string[] = [
|
|
|
|
'ROUTER_DIRECTIVES',
|
|
|
|
'ROUTER_PROVIDERS',
|
|
|
|
'Route',
|
|
|
|
'Router',
|
|
|
|
'DefaultRouterUrlSerializer',
|
|
|
|
'RouteSegment',
|
|
|
|
'RouteTree',
|
|
|
|
'RouterOutletMap',
|
|
|
|
'RouterUrlSerializer',
|
|
|
|
'Routes',
|
|
|
|
'Tree',
|
|
|
|
'UrlSegment',
|
|
|
|
'UrlTree'
|
|
|
|
];
|
|
|
|
|
|
|
|
var ROUTER_TESTING: string[] = ['ROUTER_FAKE_PROVIDERS'];
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
var API = {
|
|
|
|
'common': COMMON,
|
|
|
|
'common/testing': COMMON_TESTING,
|
|
|
|
'compiler': COMPILER,
|
|
|
|
'compiler/testing': COMPILER_TESTING,
|
|
|
|
'core': CORE,
|
|
|
|
'core/testing': CORE_TESTING,
|
|
|
|
'http': HTTP,
|
|
|
|
'http/testing': HTTP_TESTING,
|
2016-05-02 13:36:58 -04:00
|
|
|
'router-deprecated': ROUTER_DEPRECATED,
|
2016-05-26 12:52:56 -04:00
|
|
|
'router-deprecated/testing': ROUTER_DEPRECATED_TESTING,
|
2016-04-28 20:50:03 -04:00
|
|
|
'router': ROUTER,
|
|
|
|
'router/testing': ROUTER_TESTING,
|
|
|
|
'upgrade': UPGRADE,
|
|
|
|
'platform-browser': PLATFORM_BROWSER,
|
|
|
|
'platform-browser/testing': PLATFORM_BROWSER_TESTING,
|
|
|
|
'platform-server': PLATFORM_SERVER,
|
|
|
|
'platform-server/testing': PLATFORM_SERVER_TESTING
|
2015-12-10 20:21:51 -05:00
|
|
|
};
|
2015-10-26 23:17:46 -04:00
|
|
|
|
2015-09-14 23:49:29 -04:00
|
|
|
export function main() {
|
2015-09-21 19:48:16 -04:00
|
|
|
/**
|
2016-03-11 12:00:18 -05:00
|
|
|
var x = getSymbolsFromLibrary('ng');
|
|
|
|
x.sort();
|
|
|
|
var parts = [];
|
|
|
|
x.forEach((i) => parts.push(`'${i'`));
|
2015-09-21 19:48:16 -04:00
|
|
|
print(`[ ${parts.join(',
|
|
|
|
')} ]`);
|
|
|
|
*/
|
|
|
|
|
2015-09-14 23:49:29 -04:00
|
|
|
describe('public API', () => {
|
refactor(Location): out of router and into platform/common
closes https://github.com/angular/angular/issues/4943
BREAKING CHANGE:
`Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change.
Before:
```
import {
PlatformLocation,
Location,
LocationStrategy,
HashLocationStrategy,
PathLocationStrategy,
APP_BASE_HREF}
from 'angular2/router';
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
```
After:
```
import {
PlatformLocation,
Location,
LocationStrategy,
HashLocationStrategy,
PathLocationStrategy,
APP_BASE_HREF}
from 'angular2/platform/common';
import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location';
```
Closes #7962
2016-04-08 03:31:20 -04:00
|
|
|
var barrelList = [
|
2016-04-28 20:50:03 -04:00
|
|
|
'common',
|
|
|
|
'common/testing',
|
|
|
|
'compiler',
|
|
|
|
'compiler/testing',
|
|
|
|
'core',
|
|
|
|
'core/testing',
|
|
|
|
'http',
|
|
|
|
'http/testing',
|
|
|
|
'router',
|
|
|
|
'router/testing',
|
|
|
|
'upgrade',
|
|
|
|
'platform-browser',
|
|
|
|
'platform-browser/testing',
|
|
|
|
'platform-server',
|
|
|
|
'platform-server/testing'
|
refactor(Location): out of router and into platform/common
closes https://github.com/angular/angular/issues/4943
BREAKING CHANGE:
`Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change.
Before:
```
import {
PlatformLocation,
Location,
LocationStrategy,
HashLocationStrategy,
PathLocationStrategy,
APP_BASE_HREF}
from 'angular2/router';
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
```
After:
```
import {
PlatformLocation,
Location,
LocationStrategy,
HashLocationStrategy,
PathLocationStrategy,
APP_BASE_HREF}
from 'angular2/platform/common';
import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location';
```
Closes #7962
2016-04-08 03:31:20 -04:00
|
|
|
];
|
2016-03-11 12:00:18 -05:00
|
|
|
|
2015-12-10 20:21:51 -05:00
|
|
|
if (IS_DART) {
|
2016-04-28 20:50:03 -04:00
|
|
|
barrelList = barrelList.filter(b => b !== 'upgrade');
|
2015-12-10 20:21:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
barrelList.forEach(mod => {
|
|
|
|
// Dom Events are merged into DomAdapter in Dart
|
|
|
|
if (IS_DART && mod === 'ngPlatformDomEvent') return;
|
|
|
|
it(`should fail if public API for ${mod} has changed`, () => {
|
2016-03-11 12:00:18 -05:00
|
|
|
var symbols = getSymbolsFromLibrary(mod);
|
2016-04-28 20:50:03 -04:00
|
|
|
expect(diff(symbols, API[mod])).toEqual([]);
|
2015-12-10 20:21:51 -05:00
|
|
|
})
|
|
|
|
});
|
2016-03-11 12:00:18 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function diff(actual: string[], expected: string[]): string[] {
|
|
|
|
ListWrapper.sort(actual, compareIgnoreLang);
|
|
|
|
ListWrapper.sort(expected, compareIgnoreLang);
|
2016-04-12 12:40:37 -04:00
|
|
|
let mode = IS_DART ? "dart" : "js";
|
2016-03-11 12:00:18 -05:00
|
|
|
let missing = actual.filter(i => expected.indexOf(i) < 0 && expected.indexOf(`${i}:${mode}`) < 0)
|
|
|
|
.map(s => `+${s}`);
|
|
|
|
let extra = expected.filter(i => shouldIgnore(i) ? false : (actual.indexOf(stripLang(i)) < 0))
|
|
|
|
.map(s => `-${s}`);
|
|
|
|
return ListWrapper.concat(missing, extra);
|
|
|
|
}
|
2015-12-10 20:21:51 -05:00
|
|
|
|
2016-03-11 12:00:18 -05:00
|
|
|
function shouldIgnore(expected: string): boolean {
|
|
|
|
let isDart = RegExpWrapper.create('\\:dart$');
|
|
|
|
let isJs = RegExpWrapper.create('\\:js$');
|
|
|
|
return IS_DART ? RegExpWrapper.test(isJs, expected) : RegExpWrapper.test(isDart, expected);
|
|
|
|
}
|
2015-12-10 20:21:51 -05:00
|
|
|
|
2016-03-11 12:00:18 -05:00
|
|
|
function compareIgnoreLang(a: string, b: string): number {
|
|
|
|
return StringWrapper.compare(stripLang(a), stripLang(b));
|
|
|
|
}
|
|
|
|
|
|
|
|
function stripLang(text: string): string {
|
|
|
|
let index = text.indexOf(':');
|
|
|
|
return (index >= 0) ? text.substring(0, index) : text;
|
2015-09-14 23:49:29 -04:00
|
|
|
}
|