@openui5/sap.ui.core 1.115.0 → 1.116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/.dtsgenrc +18 -0
  2. package/.eslintrc.json +11 -0
  3. package/.reuse/dep5 +0 -5
  4. package/THIRDPARTY.txt +1 -7
  5. package/package.json +1 -1
  6. package/src/jquery.sap.global.js +1 -1
  7. package/src/jquery.sap.properties.js +1 -1
  8. package/src/jquery.sap.resources.js +1 -1
  9. package/src/jquery.sap.script.js +1 -1
  10. package/src/jquery.sap.sjax.js +2 -2
  11. package/src/jquery.sap.storage.js +3 -3
  12. package/src/sap/base/Event.js +106 -0
  13. package/src/sap/base/Eventing.js +320 -0
  14. package/src/sap/base/config.js +1 -1
  15. package/src/sap/base/i18n/Formatting.js +991 -0
  16. package/src/sap/base/i18n/LanguageTag.js +189 -0
  17. package/src/sap/base/i18n/Localization.js +711 -0
  18. package/src/sap/base/i18n/ResourceBundle.js +5 -20
  19. package/src/sap/base/i18n/date/CalendarType.js +54 -0
  20. package/src/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
  21. package/src/sap/base/i18n/date/TimezoneUtils.js +287 -0
  22. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  23. package/src/sap/base/util/restricted/_castArray.js +1 -1
  24. package/src/sap/base/util/restricted/_compact.js +1 -1
  25. package/src/sap/base/util/restricted/_curry.js +1 -1
  26. package/src/sap/base/util/restricted/_debounce.js +1 -1
  27. package/src/sap/base/util/restricted/_difference.js +1 -1
  28. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  29. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  30. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  31. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  32. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  33. package/src/sap/base/util/restricted/_flatten.js +1 -1
  34. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  35. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  36. package/src/sap/base/util/restricted/_intersection.js +1 -1
  37. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  38. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  39. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  40. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  41. package/src/sap/base/util/restricted/_isNil.js +1 -1
  42. package/src/sap/base/util/restricted/_max.js +1 -1
  43. package/src/sap/base/util/restricted/_merge.js +1 -1
  44. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  45. package/src/sap/base/util/restricted/_min.js +1 -1
  46. package/src/sap/base/util/restricted/_omit.js +1 -1
  47. package/src/sap/base/util/restricted/_pick.js +1 -1
  48. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  49. package/src/sap/base/util/restricted/_throttle.js +1 -1
  50. package/src/sap/base/util/restricted/_toArray.js +1 -1
  51. package/src/sap/base/util/restricted/_union.js +1 -1
  52. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  53. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  54. package/src/sap/base/util/restricted/_uniq.js +1 -1
  55. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  56. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  57. package/src/sap/base/util/restricted/_without.js +1 -1
  58. package/src/sap/base/util/restricted/_xor.js +1 -1
  59. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  60. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  61. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  62. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  63. package/src/sap/ui/Device.js +3 -3
  64. package/src/sap/ui/Global.js +4 -4
  65. package/src/sap/ui/base/Event.js +1 -1
  66. package/src/sap/ui/base/EventProvider.js +4 -12
  67. package/src/sap/ui/base/Interface.js +1 -1
  68. package/src/sap/ui/base/ManagedObject.js +8 -12
  69. package/src/sap/ui/base/ManagedObjectMetadata.js +30 -7
  70. package/src/sap/ui/base/Metadata.js +1 -1
  71. package/src/sap/ui/base/Object.js +1 -1
  72. package/src/sap/ui/base/ObjectPool.js +1 -1
  73. package/src/sap/ui/base/SyncPromise.js +10 -5
  74. package/src/sap/ui/core/.library +2 -2
  75. package/src/sap/ui/core/AccessKeysEnablement.js +10 -5
  76. package/src/sap/ui/core/AnimationMode.js +49 -0
  77. package/src/sap/ui/core/BusyIndicator.js +33 -42
  78. package/src/sap/ui/core/CalendarType.js +11 -37
  79. package/src/sap/ui/core/Component.js +4 -5
  80. package/src/sap/ui/core/ComponentContainer.js +1 -1
  81. package/src/sap/ui/core/ComponentMetadata.js +2 -2
  82. package/src/sap/ui/core/ComponentSupport.js +1 -1
  83. package/src/sap/ui/core/Configuration.js +409 -1270
  84. package/src/sap/ui/core/Control.js +4 -12
  85. package/src/sap/ui/core/ControlBehavior.js +157 -0
  86. package/src/sap/ui/core/Core.js +124 -132
  87. package/src/sap/ui/core/CustomData.js +1 -1
  88. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  89. package/src/sap/ui/core/Element.js +14 -3
  90. package/src/sap/ui/core/ElementMetadata.js +1 -1
  91. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  92. package/src/sap/ui/core/EventBus.js +1 -1
  93. package/src/sap/ui/core/Fragment.js +1 -1
  94. package/src/sap/ui/core/HTML.js +1 -1
  95. package/src/sap/ui/core/History.js +1 -1
  96. package/src/sap/ui/core/Icon.js +1 -1
  97. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  98. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  99. package/src/sap/ui/core/InvisibleMessage.js +5 -7
  100. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  101. package/src/sap/ui/core/InvisibleText.js +12 -12
  102. package/src/sap/ui/core/Item.js +1 -1
  103. package/src/sap/ui/core/LabelEnablement.js +1 -1
  104. package/src/sap/ui/core/LayoutData.js +1 -1
  105. package/src/sap/ui/core/Lib.js +109 -22
  106. package/src/sap/ui/core/ListItem.js +1 -1
  107. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  108. package/src/sap/ui/core/Locale.js +151 -430
  109. package/src/sap/ui/core/LocaleData.js +39 -11
  110. package/src/sap/ui/core/Manifest.js +1 -1
  111. package/src/sap/ui/core/Message.js +1 -1
  112. package/src/sap/ui/core/RenderManager.js +1 -1
  113. package/src/sap/ui/core/Renderer.js +1 -1
  114. package/src/sap/ui/core/ResizeHandler.js +1 -1
  115. package/src/sap/ui/core/ScrollBar.js +1 -1
  116. package/src/sap/ui/core/SeparatorItem.js +1 -1
  117. package/src/sap/ui/core/StaticArea.js +31 -17
  118. package/src/sap/ui/core/Theming.js +451 -0
  119. package/src/sap/ui/core/Title.js +1 -1
  120. package/src/sap/ui/core/TooltipBase.js +1 -1
  121. package/src/sap/ui/core/UIArea.js +1 -1
  122. package/src/sap/ui/core/UIComponent.js +1 -1
  123. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  124. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  125. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  126. package/src/sap/ui/core/XMLComposite.js +1 -1
  127. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  128. package/src/sap/ui/core/XMLTemplateProcessor.js +1 -0
  129. package/src/sap/ui/core/_IconRegistry.js +7 -1
  130. package/src/sap/ui/core/date/CalendarWeekNumbering.js +12 -83
  131. package/src/sap/ui/core/date/UI5Date.js +2 -2
  132. package/src/sap/ui/core/delegate/ItemNavigation.js +8 -10
  133. package/src/sap/ui/core/delegate/ScrollEnablement.js +5 -5
  134. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  135. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  136. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  137. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  138. package/src/sap/ui/core/format/DateFormat.js +20 -15
  139. package/src/sap/ui/core/format/TimezoneUtil.js +15 -273
  140. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  141. package/src/sap/ui/core/library.js +3 -3
  142. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  143. package/src/sap/ui/core/message/Message.js +1 -1
  144. package/src/sap/ui/core/message/MessageManager.js +1 -1
  145. package/src/sap/ui/core/message/MessageParser.js +1 -1
  146. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  147. package/src/sap/ui/core/messagebundle_cs.properties +1 -1
  148. package/src/sap/ui/core/messagebundle_cy.properties +1 -1
  149. package/src/sap/ui/core/messagebundle_da.properties +1 -1
  150. package/src/sap/ui/core/messagebundle_de.properties +1 -1
  151. package/src/sap/ui/core/messagebundle_el.properties +1 -1
  152. package/src/sap/ui/core/messagebundle_en.properties +1 -1
  153. package/src/sap/ui/core/messagebundle_en_GB.properties +1 -1
  154. package/src/sap/ui/core/messagebundle_es.properties +1 -1
  155. package/src/sap/ui/core/messagebundle_es_MX.properties +1 -1
  156. package/src/sap/ui/core/messagebundle_et.properties +1 -1
  157. package/src/sap/ui/core/messagebundle_id.properties +1 -1
  158. package/src/sap/ui/core/messagebundle_it.properties +49 -49
  159. package/src/sap/ui/core/messagebundle_iw.properties +1 -1
  160. package/src/sap/ui/core/messagebundle_kk.properties +1 -1
  161. package/src/sap/ui/core/messagebundle_ko.properties +1 -1
  162. package/src/sap/ui/core/messagebundle_lt.properties +1 -1
  163. package/src/sap/ui/core/messagebundle_lv.properties +1 -1
  164. package/src/sap/ui/core/messagebundle_ms.properties +8 -8
  165. package/src/sap/ui/core/messagebundle_nl.properties +1 -1
  166. package/src/sap/ui/core/messagebundle_no.properties +1 -1
  167. package/src/sap/ui/core/messagebundle_pl.properties +1 -1
  168. package/src/sap/ui/core/messagebundle_pt.properties +1 -1
  169. package/src/sap/ui/core/messagebundle_pt_PT.properties +1 -1
  170. package/src/sap/ui/core/messagebundle_ro.properties +1 -1
  171. package/src/sap/ui/core/messagebundle_sh.properties +1 -1
  172. package/src/sap/ui/core/messagebundle_sv.properties +1 -1
  173. package/src/sap/ui/core/messagebundle_th.properties +1 -1
  174. package/src/sap/ui/core/messagebundle_uk.properties +21 -21
  175. package/src/sap/ui/core/messagebundle_vi.properties +1 -1
  176. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  177. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  178. package/src/sap/ui/core/mvc/JSView.js +1 -1
  179. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  180. package/src/sap/ui/core/mvc/View.js +1 -1
  181. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  182. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  183. package/src/sap/ui/core/plugin/LessSupport.js +14 -16
  184. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  185. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  186. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  187. package/src/sap/ui/core/routing/HashChanger.js +1 -0
  188. package/src/sap/ui/core/routing/Route.js +1 -0
  189. package/src/sap/ui/core/routing/Router.js +3 -1
  190. package/src/sap/ui/core/rules/Config.support.js +2 -2
  191. package/src/sap/ui/core/rules/Model.support.js +3 -1
  192. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  193. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  194. package/src/sap/ui/core/service/Service.js +1 -1
  195. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  196. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  197. package/src/sap/ui/core/support/Plugin.js +1 -1
  198. package/src/sap/ui/core/support/Support.js +1 -1
  199. package/src/sap/ui/core/support/controls/TimelineOverview.js +1 -1
  200. package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
  201. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  202. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  203. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  204. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  205. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  206. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  207. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  208. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +4 -4
  209. package/src/sap/ui/core/themes/base/base.less +41 -20
  210. package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
  211. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  212. package/src/sap/ui/core/theming/Parameters.js +6 -5
  213. package/src/sap/ui/core/theming/ThemeManager.js +310 -447
  214. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  215. package/src/sap/ui/core/tmpl/DOMElement.js +5 -10
  216. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  217. package/src/sap/ui/core/tmpl/Template.js +1 -1
  218. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  219. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  220. package/src/sap/ui/core/util/Export.js +1 -1
  221. package/src/sap/ui/core/util/ExportCell.js +1 -1
  222. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  223. package/src/sap/ui/core/util/ExportRow.js +1 -1
  224. package/src/sap/ui/core/util/ExportType.js +1 -1
  225. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  226. package/src/sap/ui/core/util/File.js +1 -1
  227. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  228. package/src/sap/ui/core/util/MockServer.js +1 -1
  229. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  230. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +3 -1
  231. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  232. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  233. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  234. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  235. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  236. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  237. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  238. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  239. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  240. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  241. package/src/sap/ui/debug/ControlTree.js +1 -1
  242. package/src/sap/ui/debug/DebugEnv.js +1 -1
  243. package/src/sap/ui/debug/PropertyList.js +1 -1
  244. package/src/sap/ui/events/PseudoEvents.js +17 -9
  245. package/src/sap/ui/model/Binding.js +19 -15
  246. package/src/sap/ui/model/ClientModel.js +1 -1
  247. package/src/sap/ui/model/CompositeBinding.js +57 -19
  248. package/src/sap/ui/model/CompositeDataState.js +1 -1
  249. package/src/sap/ui/model/CompositeType.js +1 -1
  250. package/src/sap/ui/model/DataState.js +1 -1
  251. package/src/sap/ui/model/ListBinding.js +42 -1
  252. package/src/sap/ui/model/MetaModel.js +1 -1
  253. package/src/sap/ui/model/Model.js +5 -4
  254. package/src/sap/ui/model/PropertyBinding.js +10 -0
  255. package/src/sap/ui/model/SelectionModel.js +1 -1
  256. package/src/sap/ui/model/SimpleType.js +4 -1
  257. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  258. package/src/sap/ui/model/Type.js +1 -1
  259. package/src/sap/ui/model/base/ManagedObjectModel.js +1 -1
  260. package/src/sap/ui/model/json/JSONModel.js +1 -1
  261. package/src/sap/ui/model/message/MessageModel.js +1 -1
  262. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  263. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  264. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  265. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  266. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  267. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  268. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  269. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  270. package/src/sap/ui/model/odata/type/Date.js +1 -1
  271. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  272. package/src/sap/ui/model/odata/type/DateTimeBase.js +8 -1
  273. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  274. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  275. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  276. package/src/sap/ui/model/odata/type/Double.js +1 -1
  277. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  278. package/src/sap/ui/model/odata/type/Int.js +1 -1
  279. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  280. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  281. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  282. package/src/sap/ui/model/odata/type/ODataType.js +3 -3
  283. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  284. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  285. package/src/sap/ui/model/odata/type/Single.js +1 -1
  286. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  287. package/src/sap/ui/model/odata/type/String.js +1 -1
  288. package/src/sap/ui/model/odata/type/Time.js +1 -1
  289. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  290. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  291. package/src/sap/ui/model/odata/v2/Context.js +3 -2
  292. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  293. package/src/sap/ui/model/odata/v2/ODataListBinding.js +14 -3
  294. package/src/sap/ui/model/odata/v2/ODataModel.js +45 -31
  295. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  296. package/src/sap/ui/model/odata/v4/Context.js +7 -3
  297. package/src/sap/ui/model/odata/v4/ODataBinding.js +68 -39
  298. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +12 -8
  299. package/src/sap/ui/model/odata/v4/ODataListBinding.js +30 -8
  300. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +11 -9
  301. package/src/sap/ui/model/odata/v4/ODataModel.js +10 -14
  302. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +64 -31
  303. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +21 -16
  304. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +2 -0
  305. package/src/sap/ui/model/odata/v4/lib/_Cache.js +37 -14
  306. package/src/sap/ui/model/odata/v4/lib/_Helper.js +11 -1
  307. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +7 -4
  308. package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +4 -4
  309. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
  310. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  311. package/src/sap/ui/model/type/Boolean.js +1 -1
  312. package/src/sap/ui/model/type/Currency.js +1 -1
  313. package/src/sap/ui/model/type/Date.js +1 -1
  314. package/src/sap/ui/model/type/DateInterval.js +1 -1
  315. package/src/sap/ui/model/type/DateTime.js +1 -1
  316. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  317. package/src/sap/ui/model/type/FileSize.js +1 -1
  318. package/src/sap/ui/model/type/Float.js +1 -1
  319. package/src/sap/ui/model/type/Integer.js +1 -1
  320. package/src/sap/ui/model/type/String.js +1 -1
  321. package/src/sap/ui/model/type/Time.js +1 -1
  322. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  323. package/src/sap/ui/model/type/Unit.js +1 -1
  324. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  325. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  326. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  327. package/src/sap/ui/test/Opa5.js +1 -1
  328. package/src/sap/ui/test/autowaiter/_autoWaiter.js +1 -1
  329. package/src/sap/ui/test/generic/TestBase.js +1 -1
  330. package/src/sap/ui/test/gherkin/simpleGherkinParser.js +10 -5
  331. package/src/sap/ui/test/matchers/LabelFor.js +1 -0
  332. package/src/sap/ui/thirdparty/caja-html-sanitizer.js +111 -96
  333. package/src/sap/ui/util/ActivityDetection.js +7 -1
  334. package/src/sap/ui/util/Mobile.js +11 -8
  335. package/src/sap/ui/util/Storage.js +1 -1
  336. package/src/ui5loader-autoconfig.js +5 -2
  337. package/src/ui5loader.js +169 -185
  338. package/test/sap/ui/core/FormatHelper.js +3 -2
  339. package/test/sap/ui/core/demokit/docuindex.json +6 -0
  340. package/test/sap/ui/core/demokit/sample/OpaBusyIndicator/OpaBusyIndicator.js +1 -1
  341. package/test/sap/ui/core/demokit/sample/OpaMatchers/OpaMatchers.js +2 -2
  342. package/test/sap/ui/core/demokit/sample/ViewTemplate/types/MIT.ODataTypes.html +9 -14
  343. package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Opa.qunit.js +7 -0
  344. package/test/sap/ui/core/demokit/sample/common/pages/Any.js +1 -1
  345. package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/tests/filter.js +2 -2
  346. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Component.js +27 -0
  347. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.controller.js +43 -0
  348. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ListReport.view.xml +47 -0
  349. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.controller.js +27 -0
  350. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Main.view.xml +7 -0
  351. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/NotFound.view.xml +8 -0
  352. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.controller.js +123 -0
  353. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/ObjectPage.view.xml +92 -0
  354. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.html +27 -0
  355. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.js +69 -0
  356. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/README.html +55 -0
  357. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/SandboxModel.js +56 -0
  358. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/POST-SalesOrderList.json +66 -0
  359. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000')-SO_2_SOITEM.json +57 -0
  360. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000000').json +20 -0
  361. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000001').json +9 -0
  362. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList('0500000007')-SO_2_BP.json +12 -0
  363. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/SalesOrderList.json +62 -0
  364. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.json +85 -0
  365. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_CurrencyCode.xml +185 -0
  366. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.json +93 -0
  367. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/VH_ProductID.xml +262 -0
  368. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/data/metadata.xml +1779 -0
  369. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/manifest.json +134 -0
  370. package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/pages/Main.js +119 -0
  371. package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/pages/Main.js +0 -41
  372. package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/manifest.json +1 -1
  373. package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/manifest.json +1 -1
  374. package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Main.controller.js +5 -17
  375. package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Main.view.xml +3 -3
  376. package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/test/integration/arrangements/Startup.js +1 -1
  377. package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/test/integration/arrangements/Startup.js +1 -1
  378. package/test/sap/ui/core/qunit/CompositeBinding.qunit.js +25 -7
  379. package/test/sap/ui/core/qunit/ControlRenderer.qunit.js +86 -2
  380. package/test/sap/ui/core/qunit/DataState.qunit.js +2 -7
  381. package/test/sap/ui/core/qunit/HTML.qunit.js +31 -31
  382. package/test/sap/ui/core/qunit/Lib.qunit.js +55 -2
  383. package/test/sap/ui/core/qunit/LocalBusyIndicator.qunit.js +22 -15
  384. package/test/sap/ui/core/qunit/ManagedObject.qunit.js +5 -3
  385. package/test/sap/ui/core/qunit/Object.qunit.js +4 -1
  386. package/test/sap/ui/core/qunit/ThemeManager.qunit.js +2 -2
  387. package/test/sap/ui/core/qunit/ThemeParameters.qunit.js +9 -3
  388. package/test/sap/ui/core/qunit/Theming.beforeBootstrap.qunit.js +13 -0
  389. package/test/sap/ui/core/qunit/Theming.qunit.js +229 -0
  390. package/test/sap/ui/core/qunit/analytics/AnalyticalTreeBindingAdapter.qunit.js +2 -7
  391. package/test/sap/ui/core/qunit/analytics/ODataModelAdapter.qunit.js +2 -7
  392. package/test/sap/ui/core/qunit/app/MessageListBinding.qunit.js +2 -7
  393. package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.html +24 -0
  394. package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.js +275 -0
  395. package/test/sap/ui/core/qunit/base/i18n/Localization.qunit.js +259 -0
  396. package/test/sap/ui/core/qunit/base/i18n/ResourceBundle.qunit.js +5 -6
  397. package/test/sap/ui/core/qunit/base/security/sanitizeHTML.qunit.js +17 -0
  398. package/test/sap/ui/core/qunit/bootstrap/BootstrapPreload.qunit.js +1 -2
  399. package/test/sap/ui/core/qunit/bootstrap/BootstrapWithCustomBootTask.beforeBootstrap.qunit.js +13 -12
  400. package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.js +388 -254
  401. package/test/sap/ui/core/qunit/bootstrap/ThemeVersion.qunit.js +19 -30
  402. package/test/sap/ui/core/qunit/component/Models.qunit.js +7 -28
  403. package/test/sap/ui/core/qunit/component/Models_unavoidablySync.qunit.js +8 -26
  404. package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.js +2 -2
  405. package/test/sap/ui/core/qunit/component/testdata/async/lib2/library-preload.json +1 -1
  406. package/test/sap/ui/core/qunit/component/testdata/async/lib2/library.js +2 -2
  407. package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.js +2 -2
  408. package/test/sap/ui/core/qunit/component/testdata/async/lib3/library-preload.json +1 -1
  409. package/test/sap/ui/core/qunit/component/testdata/async/lib3/library.js +2 -2
  410. package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.js +2 -2
  411. package/test/sap/ui/core/qunit/component/testdata/async/lib4/library-preload.json +1 -1
  412. package/test/sap/ui/core/qunit/component/testdata/async/lib4/library.js +2 -2
  413. package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component-preload.js +1 -1
  414. package/test/sap/ui/core/qunit/component/testdata/async/manifestcomp/Component.js +2 -2
  415. package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component-preload.js +1 -1
  416. package/test/sap/ui/core/qunit/component/testdata/async/mycomp/Component.js +2 -2
  417. package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component-preload.js +1 -1
  418. package/test/sap/ui/core/qunit/component/testdata/async/mysubcomp/Component.js +2 -3
  419. package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/Component.js +0 -4
  420. package/test/sap/ui/core/qunit/component/testdata/customizing/customer/ext/sync/Component.js +2 -6
  421. package/test/sap/ui/core/qunit/component/testdata/customizing/customersub/Component.js +0 -4
  422. package/test/sap/ui/core/qunit/component/testdata/inherit/Component.js +2 -7
  423. package/test/sap/ui/core/qunit/component/testdata/inherit/parent/Component.js +2 -7
  424. package/test/sap/ui/core/qunit/component/testdata/inheritAsync/Component.js +2 -2
  425. package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentA/Component.js +2 -2
  426. package/test/sap/ui/core/qunit/component/testdata/inheritAsync/parentB/Component.js +2 -2
  427. package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/Component.js +2 -2
  428. package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentA/Component.js +2 -2
  429. package/test/sap/ui/core/qunit/component/testdata/inheritAsyncError/parentB/Component.js +2 -2
  430. package/test/sap/ui/core/qunit/component/testdata/other/Component.js +2 -7
  431. package/test/sap/ui/core/qunit/component/testdata/terminologies/Component.js +2 -2
  432. package/test/sap/ui/core/qunit/component/testdata/terminologies/component1/Component.js +2 -2
  433. package/test/sap/ui/core/qunit/component/testdata/terminologies/component2/Component.js +2 -2
  434. package/test/sap/ui/core/qunit/component/testdata/terminologies/component3/Component.js +2 -2
  435. package/test/sap/ui/core/qunit/component/testdata/terminologies/component5/Component.js +2 -2
  436. package/test/sap/ui/core/qunit/component/testdata/terminologies/reuse/Component.js +2 -3
  437. package/test/sap/ui/core/qunit/component/testdata/v1/Component.js +2 -7
  438. package/test/sap/ui/core/qunit/component/testdata/v1empty/Component.js +2 -7
  439. package/test/sap/ui/core/qunit/component/testdata/v1inline/Component.js +2 -5
  440. package/test/sap/ui/core/qunit/component/testdata/v1missing/Component.js +2 -7
  441. package/test/sap/ui/core/qunit/component/testdata/v2/Component.js +2 -5
  442. package/test/sap/ui/core/qunit/component/testdata/v2asyncRootView/Component.js +2 -5
  443. package/test/sap/ui/core/qunit/component/testdata/v2empty/Component.js +2 -9
  444. package/test/sap/ui/core/qunit/component/testdata/v2inline/Component.js +2 -5
  445. package/test/sap/ui/core/qunit/component/testdata/v2missing/Component.js +2 -9
  446. package/test/sap/ui/core/qunit/component/testdata/v2version/Component.js +2 -2
  447. package/test/sap/ui/core/qunit/dnd/DragDropInfo.qunit.js +1 -2
  448. package/test/sap/ui/core/qunit/generic/legacy/ControlMemoryLeaks.qunit.js +2 -0
  449. package/test/sap/ui/core/qunit/generic/legacy/DuplicateIdCheck.qunit.js +2 -0
  450. package/test/sap/ui/core/qunit/gherkin/dataTableUtils.qunit.js +2 -2
  451. package/test/sap/ui/core/qunit/i18n/Locale.qunit.js +0 -52
  452. package/test/sap/ui/core/qunit/i18n/LocaleData.qunit.js +1 -1
  453. package/test/sap/ui/core/qunit/i18n/UniversalDate.qunit.js +14 -24
  454. package/test/sap/ui/core/qunit/i18n/testsuite.i18n.qunit.js +18 -0
  455. package/test/sap/ui/core/qunit/internal/1RingModels.qunit.js +1 -0
  456. package/test/sap/ui/core/qunit/json/JSONListBinding.qunit.js +2 -7
  457. package/test/sap/ui/core/qunit/json/JSONPropertyBinding.qunit.js +7 -12
  458. package/test/sap/ui/core/qunit/json/JSONTwoWay.qunit.js +3 -8
  459. package/test/sap/ui/core/qunit/loader/fixture/amd-with-export-true/module1.js +2 -2
  460. package/test/sap/ui/core/qunit/messages/MessageMixin.qunit.js +2 -7
  461. package/test/sap/ui/core/qunit/messages/messagesUsage.qunit.js +1 -1
  462. package/test/sap/ui/core/qunit/model/Binding.qunit.js +36 -11
  463. package/test/sap/ui/core/qunit/model/ClientListBinding.qunit.js +2 -7
  464. package/test/sap/ui/core/qunit/model/ClientTreeBinding.qunit.js +2 -7
  465. package/test/sap/ui/core/qunit/model/CompositeDataState.qunit.js +2 -7
  466. package/test/sap/ui/core/qunit/model/Context.qunit.js +2 -7
  467. package/test/sap/ui/core/qunit/model/ContextBinding.qunit.js +2 -7
  468. package/test/sap/ui/core/qunit/model/ListBinding.qunit.js +63 -6
  469. package/test/sap/ui/core/qunit/model/Model.qunit.js +2 -7
  470. package/test/sap/ui/core/qunit/model/PropertyBinding.qunit.js +40 -0
  471. package/test/sap/ui/core/qunit/model/TreeBinding.qunit.js +2 -7
  472. package/test/sap/ui/core/qunit/model/TreeBindingAdapter.qunit.js +2 -7
  473. package/test/sap/ui/core/qunit/mvc/XMLView.qunit.js +9 -8
  474. package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions.qunit.js +4 -4
  475. package/test/sap/ui/core/qunit/mvc/extensions/Controllerextensions_legacy.qunit.js +4 -4
  476. package/test/sap/ui/core/qunit/odata/AnnotationParserNoFakeService.qunit.js +2 -7
  477. package/test/sap/ui/core/qunit/odata/ODataMessageParser.qunit.js +1 -1
  478. package/test/sap/ui/core/qunit/odata/ODataMessageParserNoFakeService.qunit.js +2 -8
  479. package/test/sap/ui/core/qunit/odata/ODataMetadataNoFakeService.qunit.js +1 -6
  480. package/test/sap/ui/core/qunit/odata/type/DateTimeBase.qunit.js +24 -0
  481. package/test/sap/ui/core/qunit/odata/v2/Context.qunit.js +2 -7
  482. package/test/sap/ui/core/qunit/odata/v2/ODataContextBindingNoFakeService.qunit.js +2 -7
  483. package/test/sap/ui/core/qunit/odata/v2/ODataListBindingNoFakeService.qunit.js +31 -17
  484. package/test/sap/ui/core/qunit/odata/v2/ODataModel.integration.qunit.js +28 -19
  485. package/test/sap/ui/core/qunit/odata/v2/ODataModelNoFakeService.qunit.js +70 -15
  486. package/test/sap/ui/core/qunit/odata/v2/ODataPropertyBindingNoFakeService.qunit.js +2 -7
  487. package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingFlatNoFakeService.qunit.js +4 -9
  488. package/test/sap/ui/core/qunit/odata/v2/ODataTreeBindingNoFakeService.qunit.js +2 -7
  489. package/test/sap/ui/core/qunit/odata/v2/_CreatedContextsCache.qunit.js +2 -7
  490. package/test/sap/ui/core/qunit/odata/v4/AnnotationHelper.qunit.js +1 -1
  491. package/test/sap/ui/core/qunit/odata/v4/Context.qunit.js +45 -17
  492. package/test/sap/ui/core/qunit/odata/v4/ODataBinding.qunit.js +152 -151
  493. package/test/sap/ui/core/qunit/odata/v4/ODataContextBinding.qunit.js +55 -27
  494. package/test/sap/ui/core/qunit/odata/v4/ODataListBinding.qunit.js +119 -4
  495. package/test/sap/ui/core/qunit/odata/v4/ODataMetaModel.qunit.js +3 -3
  496. package/test/sap/ui/core/qunit/odata/v4/ODataModel.integration.qunit.js +754 -195
  497. package/test/sap/ui/core/qunit/odata/v4/ODataModel.qunit.js +42 -53
  498. package/test/sap/ui/core/qunit/odata/v4/ODataParentBinding.qunit.js +283 -170
  499. package/test/sap/ui/core/qunit/odata/v4/ODataPropertyBinding.qunit.js +103 -78
  500. package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationCache.qunit.js +3 -0
  501. package/test/sap/ui/core/qunit/odata/v4/lib/_Cache.qunit.js +87 -58
  502. package/test/sap/ui/core/qunit/odata/v4/lib/_Helper.qunit.js +3 -1
  503. package/test/sap/ui/core/qunit/odata/v4/lib/_Requestor.qunit.js +124 -22
  504. package/test/sap/ui/core/qunit/odata/v4/testsuite.odatav4.qunit.js +4 -0
  505. package/test/sap/ui/core/qunit/opa/_LogCollector.qunit.js +1 -1
  506. package/test/sap/ui/core/qunit/performance/trace/FESR.qunit.js +5 -0
  507. package/test/sap/ui/core/qunit/resource/ResourceModel.qunit.js +17 -37
  508. package/test/sap/ui/core/qunit/routing/HashChanger.qunit.js +1 -6
  509. package/test/sap/ui/core/qunit/routing/RouterHashChanger.qunit.js +1 -10
  510. package/test/sap/ui/core/qunit/routing/async/Router.qunit.js +1 -22
  511. package/test/sap/ui/core/qunit/routing/async/Target.qunit.js +1 -4
  512. package/test/sap/ui/core/qunit/rule/model/modelSupport.qunit.js +34 -1
  513. package/test/sap/ui/core/qunit/testdata/fastnavigation/view/FastNavigation.view.xml +2 -2
  514. package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/i18n.properties +1 -0
  515. package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/library.js +10 -0
  516. package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib1/manifest.json +10 -0
  517. package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/library.js +10 -0
  518. package/test/sap/ui/core/qunit/testdata/libraries/resourcebundle/lib2/messagebundle.properties +1 -0
  519. package/test/sap/ui/core/qunit/testsuites/testsuite.databinding.qunit.js +3 -0
  520. package/test/sap/ui/core/qunit/testsuites/testsuite.theming.qunit.js +29 -0
  521. package/test/sap/ui/core/qunit/types/DateFormatTimezones.qunit.js +397 -607
  522. package/test/sap/ui/core/qunit/types/SimpleType.qunit.js +16 -2
  523. package/test/sap/ui/core/qunit/types/Types.qunit.js +2 -37
  524. package/test/sap/ui/core/qunit/types/testsuite.types.qunit.js +1 -1
  525. package/test/sap/ui/core/qunit/util/SyncPromise.qunit.js +4 -1
  526. package/test/sap/ui/core/qunit/util/jQuery.sap.measure.qunit.js +16 -11
  527. package/test/sap/ui/core/qunit/xml/XMLListBinding.qunit.js +1 -3
  528. package/test/sap/ui/core/qunit/xml/XMLModel.qunit.js +4 -14
  529. package/test/sap/ui/core/qunit/xml/XMLPropertyBinding.qunit.js +7 -11
  530. package/test/sap/ui/core/qunit/xml/XMLTreeBinding.qunit.js +1 -1
  531. package/test/sap/ui/core/qunit/xml/XMLTwoWay.qunit.js +3 -7
  532. package/test/sap/ui/core/relnotes/changes-1.115.json +1 -37
  533. package/test/sap/ui/core/relnotes/changes-1.116.json +82 -0
  534. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/firstItem-contextMenu.ref.lnk +1 -1
  535. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/initial.ref.lnk +1 -1
  536. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/lastItem-contextMenu.ref.lnk +1 -1
  537. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/leftDownBtn-contextMenu.ref.lnk +1 -1
  538. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/myButtonSample-contextMenu.ref.lnk +1 -1
  539. package/test/sap/ui/core/visual/images/ContextMenuSupport/windows/1600x1200/chrome/horizon/ltr/cozy/rightDownBtn-contextMenu.ref.lnk +1 -1
  540. package/test/testsuite/js/samples.js +2 -0
  541. package/ui5.yaml +1 -1
@@ -1,6 +1,6 @@
1
1
  /*global QUnit, sinon */
2
2
  QUnit.config.autostart = false;
3
-
3
+ QUnit.config.reorder = false;
4
4
  sap.ui.require([
5
5
  'sap/ui/core/CalendarType',
6
6
  'sap/ui/core/Configuration',
@@ -8,13 +8,16 @@ sap.ui.require([
8
8
  'sap/ui/core/date/CalendarWeekNumbering',
9
9
  'sap/ui/core/format/TimezoneUtil',
10
10
  'sap/ui/core/Locale',
11
- 'sap/base/Log',
11
+ 'sap/ui/base/Interface',
12
+ 'sap/ui/core/Theming',
12
13
  'sap/base/config',
14
+ 'sap/base/Log',
15
+ "sap/base/config/GlobalConfigurationProvider",
13
16
  'sap/routing/HistoryUtils',
14
- 'sap/ui/base/Interface',
17
+ 'sap/ui/base/config/URLConfigurationProvider',
15
18
  'sap/ui/core/LocaleData' // only used indirectly via Configuration.getCalendarType
16
- ], function(CalendarType, Configuration, Core, CalendarWeekNumbering, TimezoneUtil, Locale, Log, BaseConfig,
17
- HistoryUtils, Interface/*, LocaleData*/) {
19
+ ], function(CalendarType, Configuration, Core, CalendarWeekNumbering, TimezoneUtil, Locale, Interface, Theming, BaseConfig, Log,
20
+ GlobalConfigurationProvider, HistoryUtils, URLConfigurationProvider/*, LocaleData*/) {
18
21
  "use strict";
19
22
 
20
23
  var browserUrl = {
@@ -42,14 +45,6 @@ sap.ui.require([
42
45
  return document.documentElement.getAttribute(sAttribute);
43
46
  }
44
47
 
45
- // used to get access to the non-public core parts
46
- var oRealCore;
47
- var TestCorePlugin = function() {};
48
- TestCorePlugin.prototype.startPlugin = function(oCore, bOnInit) {
49
- oRealCore = oCore;
50
- };
51
- sap.ui.getCore().registerPlugin(new TestCorePlugin());
52
-
53
48
  // Initialize the HistoryUtils
54
49
  QUnit.begin(HistoryUtils.init);
55
50
 
@@ -69,7 +64,7 @@ sap.ui.require([
69
64
  assert.ok(oLogSpy.calledTwice, "There should be two errors logged for each constructor call.");
70
65
  assert.strictEqual(oLogSpy.getCall(0).args[0], sExpectedErrorText, "Correct error logged");
71
66
  assert.strictEqual(oLogSpy.getCall(1).args[0], sExpectedErrorText, "Correct error logged");
72
- assert.strictEqual(oConfiguration1.calendarWeekNumbering, CalendarWeekNumbering.Default,
67
+ assert.strictEqual(oConfiguration1.getCalendarWeekNumbering(), CalendarWeekNumbering.Default,
73
68
  "calendar week number is set to default in c'tor");
74
69
  oLogSpy.restore();
75
70
  });
@@ -109,8 +104,9 @@ sap.ui.require([
109
104
  });
110
105
 
111
106
  QUnit.test("getter and setter for option 'calendar'", function(assert) {
112
- var oCfg = new Configuration(),
107
+ var oCfg = Configuration,
113
108
  oFormatSettings = oCfg.getFormatSettings();
109
+ oFormatSettings.setLegacyDateFormat();
114
110
 
115
111
  assert.equal(oCfg.getCalendarType(), CalendarType.Islamic, "The bootstrap parameter is respected");
116
112
 
@@ -169,25 +165,21 @@ sap.ui.require([
169
165
 
170
166
  oFormatSettings.setLegacyDateFormat("C");
171
167
  assert.equal(oCfg.getCalendarType(), CalendarType.Persian, "The legacy date format 'C' changes the calendar type to persian");
172
-
168
+ //reset language
169
+ oCfg.setLanguage("en");
173
170
  });
174
171
 
175
172
  QUnit.test("getter and setter for option calendarWeekNumbering", function(assert) {
176
- var mChanges = {},
177
- oConfiguration = new Configuration();
173
+ var oConfiguration = new Configuration();
178
174
 
179
175
  assert.strictEqual(oConfiguration.getCalendarWeekNumbering(), CalendarWeekNumbering.Default);
180
176
 
181
- this.mock(oConfiguration).expects("_collect").withExactArgs().returns(mChanges);
182
- this.mock(oConfiguration).expects("_endCollect").withExactArgs();
183
-
184
- assert.strictEqual(oConfiguration.setCalendarWeekNumbering(CalendarWeekNumbering.ISO_8601), oConfiguration);
185
- assert.strictEqual(mChanges.calendarWeekNumbering, CalendarWeekNumbering.ISO_8601);
177
+ assert.ok(oConfiguration.setCalendarWeekNumbering(CalendarWeekNumbering.ISO_8601), oConfiguration);
186
178
  assert.strictEqual(oConfiguration.getCalendarWeekNumbering(), CalendarWeekNumbering.ISO_8601);
187
179
 
188
180
  assert.throws(function() {
189
181
  oConfiguration.setCalendarWeekNumbering("invalid");
190
- }, new Error("Unsupported Enumeration value for calendarWeekNumbering, valid values are: "
182
+ }, new TypeError("Unsupported Enumeration value for calendarWeekNumbering, valid values are: "
191
183
  + "Default, ISO_8601, MiddleEastern, WesternTraditional"));
192
184
  });
193
185
 
@@ -205,9 +197,10 @@ sap.ui.require([
205
197
  this.changes.push(changes);
206
198
  }.bind(this)
207
199
  };
208
- window['sap-ui-config'] = {
209
- language: 'en'
210
- };
200
+ Configuration.setRTL(null);
201
+ Configuration.setLanguage("en");
202
+ Configuration.setCalendarWeekNumbering(CalendarWeekNumbering.Default);
203
+ Configuration.setCalendarType("Gregorian");
211
204
  Configuration.setCore(this.oCoreMock);
212
205
  this.oConfig = Configuration;
213
206
  }
@@ -273,6 +266,8 @@ sap.ui.require([
273
266
  assert.equal(this.oConfig.getTimezone(), sDifferentTimezone, "timezone should be '" + sDifferentTimezone + "'");
274
267
  assert.equal(this.eventsReceived, 1, "one localizationChange event should have been fired");
275
268
  assert.deepEqual(Object.keys(this.changes[0]), ['timezone'], "event should have reported 'timezone' as changed");
269
+ // reset to local timezone
270
+ this.oConfig.setTimezone(sLocalTimezone);
276
271
  });
277
272
 
278
273
  QUnit.test("setTimezone(null) - simple", function(assert) {
@@ -454,15 +449,23 @@ sap.ui.require([
454
449
 
455
450
  oConfig.setLanguage("sr-Latn");
456
451
  assert.equal(oConfig.getSAPLogonLanguage(), "SH", "SAP Logon language should be 'SH'");
457
- assert.equal(oConfig.getLanguageTag(), "sh", "Language Tag should be 'sr-Latn'");
452
+ assert.equal(oConfig.getLanguageTag(), "sh", "Language Tag should be 'sh'");
458
453
 
459
454
  oConfig.setLanguage("sh");
460
455
  assert.equal(oConfig.getSAPLogonLanguage(), "SH", "SAP Logon language should be 'SH'");
461
- assert.equal(oConfig.getLanguageTag(), "sh", "Language Tag should be 'sr-Latn'");
456
+ assert.equal(oConfig.getLanguageTag(), "sh", "Language Tag should be 'sh'");
462
457
 
463
458
  oConfig.setLanguage("sr");
464
459
  assert.equal(oConfig.getSAPLogonLanguage(), "SR", "SAP Logon language should be 'SR'");
465
460
  assert.equal(oConfig.getLanguageTag(), "sr", "Language Tag should be 'sr'");
461
+
462
+ oConfig.setLanguage("iw");
463
+ assert.equal(oConfig.getSAPLogonLanguage(), "HE", "SAP Logon language should be 'HE'");
464
+ assert.equal(oConfig.getLanguageTag(), "he", "Language Tag should be 'he'");
465
+
466
+ oConfig.setLanguage("ji");
467
+ assert.equal(oConfig.getSAPLogonLanguage(), "YI", "SAP Logon language should be 'YI'");
468
+ assert.equal(oConfig.getLanguageTag(), "yi", "Language Tag should be 'yi'");
466
469
  });
467
470
 
468
471
  QUnit.test("configured via API", function(assert) {
@@ -479,40 +482,57 @@ sap.ui.require([
479
482
  });
480
483
 
481
484
  QUnit.module("SAP Logon Language (via url)", {
485
+ before: function() {
486
+ this.oConfig = Configuration;
487
+ },
482
488
  beforeEach: function(assert) {
483
- this.setupConfig = function(sLanguage, sUrl) {
489
+ this.setupConfig = function(sLanguage, data) {
484
490
  var oCoreMock = {
485
491
  fireLocalizationChanged: function() {}
486
492
  };
487
- window["sap-ui-config"] = window["sap-ui-config"] || {};
488
- window["sap-ui-config"].language = sLanguage;
489
- browserUrl.change(sUrl);
493
+ data = data ? data : {};
494
+ this.oStub && this.oStub.restore();
495
+ this.oStub = sinon.stub(BaseConfig, "get");
496
+ this.oStub.callsFake(function(mParameters) {
497
+ if (mParameters.name === "sapUiLanguage") {
498
+ return data["sap-ui-language"] || sLanguage || "";
499
+ } else if (mParameters.name === "sapLanguage") {
500
+ return data["sap-language"] || this.oStub.wrappedMethod.call(this, mParameters);
501
+ } else if (mParameters.name === "sapLocale") {
502
+ return data["sap-locale"] || this.oStub.wrappedMethod.call(this, mParameters);
503
+ } else if (mParameters.name === "sapUiFormatLocale") {
504
+ return data["sap-ui-formatLocale"] ? new Locale(data["sap-ui-formatLocale"]) : this.oStub.wrappedMethod.call(this, mParameters);
505
+ } else {
506
+ return this.oStub.wrappedMethod.call(this, mParameters);
507
+ }
508
+ }.bind(this));
509
+
490
510
  // reset sapLogonLanguage
491
- Configuration.setLanguage("xx", undefined);
511
+ this.oConfig.setCalendarWeekNumbering(CalendarWeekNumbering.Default);
492
512
  Configuration.setCore(oCoreMock);
493
513
  return Configuration;
494
514
  };
495
515
  },
496
516
  afterEach: function() {
497
- browserUrl.reset();
517
+ this.oStub && this.oStub.restore();
498
518
  }
499
519
  });
500
520
 
501
521
  [
502
522
  /* URL parameter language languageTag SAP-L Caption */
503
- [ "?sap-language=en", "en", "en", "EN", "sap-language is the valid ISO language EN"],
504
- [ "?sap-language=EN", "EN", "en", "EN", "sap-language is the valid ISO language EN"],
505
- [ "?sap-language=ZH", "zh-Hans", "zh-Hans", "ZH", "sap-language is the known SAP language ZN"],
506
- [ "?sap-language=ZF", "zh-Hant", "zh-Hant", "ZF", "sap-language is the known SAP language ZF"],
507
- [ "?sap-language=1Q", "en-US-x-saptrc", "en-US-x-saptrc", "1Q", "sap-language is the known SAP language 1Q"],
508
- [ "?sap-language=2Q", "en-US-x-sappsd", "en-US-x-sappsd", "2Q", "sap-language is the known SAP language 2Q"],
509
- [ "?sap-language=3Q", "en-US-x-saprigi", "en-US-x-saprigi", "3Q", "sap-language is the known SAP language 3Q"],
510
- [ "?sap-language=6N", "en-GB", "en-GB", "6N", "sap-language is the unknown SAP language 6N"],
511
- [ "?sap-language=SH", "sr-Latn", "sh", "SH", "sap-language is the unknown SAP language 6N"],
512
- [ "?sap-locale=fr_CH", "fr_CH", "fr-CH", "FR", "sap-locale is the accepted BCP47 tag fr_CH"],
513
- [ "?sap-locale=En_gb&sap-language=6N", "En_gb", "en-GB", "6N", "valid combination of sap-locale and sap-language (En_gb, 6N)"],
514
- [ "?sap-ui-language=en_GB&sap-language=6N", "en_GB", "en-GB", "6N", "valid combination of sap-ui-language and sap-language (en_GB, 6N)"],
515
- [ "?sap-language=EN&sap-locale=en_GB", "en_GB", "en-GB", "EN", "valid combination of sap-language and sap-locale, both as BCP47 tag (EN, en_GB)"]
523
+ [ {"sap-language": "en"}, "en", "en", "EN", "sap-language is the valid ISO language EN"],
524
+ [ {"sap-language": "EN"}, "EN", "en", "EN", "sap-language is the valid ISO language EN"],
525
+ [ {"sap-language": "ZH"}, "zh-Hans", "zh-Hans", "ZH", "sap-language is the known SAP language ZN"],
526
+ [ {"sap-language": "ZF"}, "zh-Hant", "zh-Hant", "ZF", "sap-language is the known SAP language ZF"],
527
+ [ {"sap-language": "1Q"}, "en-US-x-saptrc", "en-US-x-saptrc", "1Q", "sap-language is the known SAP language 1Q"],
528
+ [ {"sap-language": "2Q"}, "en-US-x-sappsd", "en-US-x-sappsd", "2Q", "sap-language is the known SAP language 2Q"],
529
+ [ {"sap-language": "3Q"}, "en-US-x-saprigi", "en-US-x-saprigi", "3Q", "sap-language is the known SAP language 3Q"],
530
+ [ {"sap-language": "6N"}, "en-GB", "en-GB", "6N", "sap-language is the unknown SAP language 6N"],
531
+ [ {"sap-language": "SH"}, "sr-Latn", "sh", "SH", "sap-language is the unknown SAP language 6N"],
532
+ [ {"sap-locale": "fr_CH"}, "fr_CH", "fr-CH", "FR", "sap-locale is the accepted BCP47 tag fr_CH"],
533
+ [ {"sap-locale": "En_gb", "sap-language": "6N"}, "En_gb", "en-GB", "6N", "valid combination of sap-locale and sap-language (En_gb, 6N)"],
534
+ [ {"sap-ui-language":"en_GB", "sap-language": "6N"}, "en-GB", "en-GB", "6N", "valid combination of sap-ui-language and sap-language (en_GB, 6N)"],
535
+ [ {"sap-language": "EN", "sap-locale": "en_GB"}, "en_GB", "en-GB", "EN", "valid combination of sap-language and sap-locale, both as BCP47 tag (EN, en_GB)"]
516
536
  ].forEach(function( data ) {
517
537
 
518
538
  QUnit.test(data[4], function(assert) {
@@ -526,97 +546,123 @@ sap.ui.require([
526
546
 
527
547
  });
528
548
 
529
- QUnit.test("language via url, locale+language via API", function(assert) {
549
+ // url: sap-language=en
550
+ // window: language=de
551
+ // ==> en
552
+ // url: sap-language=en&sap-ui-language=de
553
+ // ==> de
530
554
 
531
- var oConfig = this.setupConfig("de", "?sap-language=6N");
555
+ QUnit.test("language via url, locale+language via API", function(assert) {
556
+ var oConfig = this.setupConfig("de", {"sap-language": "6N"});
532
557
  assert.equal(oConfig.getLanguage(), "en-GB", "the effective language still should be 'en-GB'");
533
558
  assert.equal(oConfig.getLanguageTag(), "en-GB", "the effective language tag still should be 'en-GB'");
534
559
  assert.equal(oConfig.getSAPLogonLanguage(), "6N", "the SAP Logon language should be '6N' already");
535
-
536
- oConfig = this.setupConfig("de", "?sap-language=1E");
560
+ oConfig = this.setupConfig("de", {"sap-language":"1E"});
537
561
  assert.equal(oConfig.getLanguage(), "de", "the effective language still should be 'de'");
538
562
  assert.equal(oConfig.getLanguageTag(), "de", "the effective language tag still should be 'de'");
539
563
  assert.equal(oConfig.getSAPLogonLanguage(), "1E", "the SAP Logon language should be '6N' already");
564
+ });
540
565
 
566
+ QUnit.test("language via url, locale+language via API", function(assert) {
541
567
  // without the second parameter, the sap language now would be 'EN' only
542
- oConfig.setLanguage("en-GB");
543
- assert.equal(oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
544
- assert.equal(oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
545
- assert.equal(oConfig.getSAPLogonLanguage(), "6N", "the SAP Logon language should be 'EN'");
568
+ this.oConfig.setLanguage("en-GB");
569
+ assert.equal(this.oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
570
+ assert.equal(this.oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
571
+ assert.equal(this.oConfig.getSAPLogonLanguage(), "6N", "the SAP Logon language should be 'EN'");
546
572
 
547
573
  // but with the second parameter, everything should be fine
548
- oConfig.setLanguage("en-GB", "6N");
549
- assert.equal(oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
550
- assert.equal(oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
551
- assert.equal(oConfig.getSAPLogonLanguage(), "6N", "the SAP Logon language should be '6N'");
574
+ this.oConfig.setLanguage("en-GB", "6N");
575
+ assert.equal(this.oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
576
+ assert.equal(this.oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
577
+ assert.equal(this.oConfig.getSAPLogonLanguage(), "6N", "the SAP Logon language should be '6N'");
552
578
 
553
- oConfig.setLanguage("en-GB", "1E");
554
- assert.equal(oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
555
- assert.equal(oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
556
- assert.equal(oConfig.getSAPLogonLanguage(), "1E", "the SAP Logon language should be '1E'");
579
+ this.oConfig.setLanguage("en-GB", "1E");
580
+ assert.equal(this.oConfig.getLanguage(), "en-GB", "the effective language should be 'en-GB'");
581
+ assert.equal(this.oConfig.getLanguageTag(), "en-GB", "the effective language tag should be 'en-GB'");
582
+ assert.equal(this.oConfig.getSAPLogonLanguage(), "1E", "the SAP Logon language should be '1E'");
557
583
 
558
584
  });
559
585
 
560
586
  QUnit.test("error reporting", function(assert) {
561
- this.stub(Log, 'warning');
562
- this.setupConfig("de", "?sap-language=1E&sap-locale=en-GB");
587
+ this.stub(Log, 'warning').callThrough();
588
+ this.setupConfig("de", {"sap-language":"1E", "sap-locale": "en-GB"});
589
+ this.oConfig.getLanguage();
563
590
  assert.strictEqual(Log.warning.called, false, "no warning should be written if accompanied by sap-locale");
564
- this.setupConfig("de", "?sap-language=1E&sap-ui-language=en-GB");
591
+ this.setupConfig("de", {"sap-language":"1E", "sap-ui-language":"en-GB"});
592
+ this.oConfig.getLanguage();
565
593
  assert.strictEqual(Log.warning.called, false, "no warning should be written if accompanied by sap-ui-language");
566
- this.setupConfig("de", "?sap-language=1E");
594
+ this.setupConfig(null, {"sap-language" :"1E"});
595
+ this.oConfig.getLanguage();
567
596
  assert.ok(Log.warning.calledWith(sinon.match(/1E/).and(sinon.match(/BCP-?47/i))), "warning must have been written");
568
597
  assert.throws(function() {
569
- this.setupConfig("de", "?sap-locale=1E&sap-language=1E");
598
+ this.setupConfig("de", {"sap-locale":"1E","sap-language":"1E"});
599
+ this.oConfig.getLanguage();
570
600
  }, "setting an invalid (non-BCP-47) sap-locale should cause an error");
571
601
  assert.throws(function() {
572
- this.setupConfig("de", "?sap-ui-language=1E&sap-language=1E");
602
+ this.setupConfig("de", {"sap-ui-language":"1E", "sap-language":"1E"});
603
+ this.oConfig.getLanguage();
573
604
  }, "setting an invalid (non-BCP-47) sap-ui-language should cause an error");
574
605
  });
575
606
 
576
607
  QUnit.test("Format Locale", function(assert) {
577
- var checkPublicMethods = function (oObject, fnClass) {
578
- var aMethodNames = fnClass.getMetadata().getAllPublicMethods(), i;
579
-
580
- for ( i = 0; i < aMethodNames.length; i++ ) {
581
- assert.ok(oObject[aMethodNames[i]] !== undefined, "expected interface method should actually exist: " + aMethodNames[i]);
608
+ var rMethodsToIgnore = /^(_|destroy|getInterface$|getMetadata$|isA$)/;
609
+
610
+ // Checks via duck-typing whether the given object is an instance of Locale
611
+ // The check should work with facades (1.x) as well as with instances (2.x)
612
+ function assertCoreLocale(oObject) {
613
+ var aMethodNames = Object.keys(Locale.prototype).filter(function(sKey) {
614
+ return !rMethodsToIgnore.test(sKey) && typeof Locale.prototype[sKey] === "function";
615
+ });
616
+
617
+ aMethodNames.forEach(function(sMethodName) {
618
+ assert.strictEqual(typeof oObject[sMethodName], "function",
619
+ "expected interface method should actually exist: " + sMethodName);
620
+ });
621
+
622
+ for ( var sMethodName in oObject ) {
623
+ if ( !rMethodsToIgnore.test(sMethodName) && typeof oObject[sMethodName] === "function" ) {
624
+ assert.ok(aMethodNames.includes(sMethodName),
625
+ "actual method should be part of expected interface: " + sMethodName);
626
+ }
582
627
  }
628
+ }
583
629
 
584
- for ( i in oObject ) {
585
- assert.ok(aMethodNames.indexOf(i) >= 0, "actual method should be part of expected interface: " + i);
586
- }
587
- };
588
630
  var oConfig;
589
631
 
590
- window['sap-ui-config'].formatlocale = 'fr-CH'; // Note: Configuration expects sap-ui-config names converted to lowercase (done by bootstrap)
591
- oConfig = this.setupConfig("fr-FR", "");
632
+ //window['sap-ui-config'].formatlocale = 'fr-CH'; // Note: Configuration expects sap-ui-config names converted to lowercase (done by bootstrap)
633
+ oConfig = this.setupConfig("fr-FR", {});
634
+ oConfig.setFormatLocale("fr-CH");
592
635
  assert.equal(oConfig.getLanguageTag(), "fr-FR", "language should be fr-FR");
593
636
  assert.equal(oConfig.getFormatLocale(), "fr-CH", "format locale string should be fr-CH");
594
- assert.ok(oConfig.getFormatSettings().getFormatLocale() instanceof Interface, "format locale should exist");
637
+ assert.ok(oConfig.getFormatSettings().getFormatLocale(), "format locale should exist");
638
+ assertCoreLocale(oConfig.getFormatSettings().getFormatLocale());
595
639
  assert.equal(oConfig.getFormatSettings().getFormatLocale().toString(), "fr-CH", "format locale should be fr-CH");
596
640
 
597
- window['sap-ui-config'].formatlocale = null;
598
- oConfig = this.setupConfig("fr-FR", "");
641
+ //window['sap-ui-config'].formatlocale = null;
642
+ oConfig = this.setupConfig("fr-FR", {});
643
+ oConfig.setFormatLocale(null);
599
644
  assert.equal(oConfig.getLanguageTag(), "fr-FR", "language should be fr-FR");
600
645
  assert.equal(oConfig.getFormatLocale(), "fr-FR", "format locale string should be fr-CH");
601
- assert.ok(oConfig.getFormatSettings().getFormatLocale() instanceof Interface, "format locale should exist");
602
- checkPublicMethods(Configuration.getFormatSettings().getFormatLocale(), Locale);
646
+ assert.ok(oConfig.getFormatSettings().getFormatLocale(), "format locale should exist");
603
647
  assert.equal(oConfig.getFormatSettings().getFormatLocale().toString(), "fr-FR", "format locale should be fr-CH");
604
648
  delete window['sap-ui-config'].formatlocale;
605
649
 
606
- oConfig = this.setupConfig("de", "?sap-language=EN&sap-ui-formatLocale=en-AU");
650
+ oConfig = this.setupConfig("de", {"sap-language": "EN", "sap-ui-formatLocale": "en-AU"});
607
651
  assert.equal(oConfig.getLanguageTag(), "en", "language should be en");
608
652
  assert.equal(oConfig.getFormatLocale(), "en-AU", "format locale string should be en-AU");
609
- assert.ok(oConfig.getFormatSettings().getFormatLocale() instanceof Interface, "format locale should exist");
653
+ assert.ok(oConfig.getFormatSettings().getFormatLocale(), "format locale should exist");
610
654
  assert.equal(oConfig.getFormatSettings().getFormatLocale().toString(), "en-AU", "format locale should be en-AU");
611
655
 
656
+ oConfig = this.setupConfig();
612
657
  oConfig.setFormatLocale("en-CA");
613
658
  assert.equal(oConfig.getFormatLocale(), "en-CA", "format locale string should be en-CA");
614
- assert.ok(oConfig.getFormatSettings().getFormatLocale() instanceof Interface, "format locale should exist");
659
+ assert.ok(oConfig.getFormatSettings().getFormatLocale(), "format locale should exist");
615
660
  assert.equal(oConfig.getFormatSettings().getFormatLocale().toString(), "en-CA", "format locale should be en-CA");
616
661
 
662
+ oConfig = this.setupConfig("de", {"sap-language": "EN"});
617
663
  oConfig.setFormatLocale();
618
664
  assert.equal(oConfig.getFormatLocale(), "en", "format locale string should be en");
619
- assert.ok(oConfig.getFormatSettings().getFormatLocale() instanceof Interface, "format locale should exist");
665
+ assert.ok(oConfig.getFormatSettings().getFormatLocale(), "format locale should exist");
620
666
  assert.equal(oConfig.getFormatSettings().getFormatLocale().toString(), "en", "format locale should be en");
621
667
 
622
668
  assert.throws(function() {
@@ -636,9 +682,7 @@ sap.ui.require([
636
682
  });
637
683
 
638
684
  QUnit.test("Read 'sap-ui-legacy-number-format' from URL", function(assert) {
639
-
640
- var oSpySetLegacyNumberFormat = this.spy(Configuration.FormatSettings.prototype, "setLegacyNumberFormat");
641
-
685
+ var oStub;
642
686
  [
643
687
  { param: '', expected: undefined },
644
688
  { param: ' ', expected: ' ' },
@@ -647,24 +691,27 @@ sap.ui.require([
647
691
  { param: 'Y', expected: 'Y' },
648
692
  { param: 'y', expected: 'Y' }
649
693
  ].forEach(function (data) {
650
-
651
694
  // setup
652
- browserUrl.change('?sap-ui-legacy-number-format=' + encodeURIComponent(data.param));
653
- oSpySetLegacyNumberFormat.resetHistory();
654
-
695
+ oStub && oStub.restore();
696
+ oStub = sinon.stub(BaseConfig, "get");
697
+ oStub.callsFake(function(mParameters) {
698
+ if (mParameters.name === "sapUiLegacyNumberFormat") {
699
+ return data.param;
700
+ } else {
701
+ return oStub.wrappedMethod.call(this, mParameters);
702
+ }
703
+ }.bind(this));
655
704
  // call method under test
656
705
  Configuration.setCore();
657
706
 
658
707
  // verify results
659
- assert.equal(oSpySetLegacyNumberFormat.callCount, 1, "setLegacyNumberFormat with value: '" + data.param + "' must be called");
660
708
  assert.equal(Configuration.getFormatSettings().getLegacyNumberFormat(), data.expected, "Value of number format must be '" + data.expected + "'.");
661
- });
709
+ }.bind(this));
710
+ oStub.restore();
662
711
  });
663
712
 
664
713
  QUnit.test("Read 'sap-ui-legacy-date-format' from URL", function(assert) {
665
-
666
- var oSpySetLegacyDateFormat = this.spy(Configuration.FormatSettings.prototype, "setLegacyDateFormat");
667
-
714
+ var oStub;
668
715
  [
669
716
  { param: '', expected: undefined },
670
717
  { param: '1', expected: '1' },
@@ -683,19 +730,26 @@ sap.ui.require([
683
730
  { param: 'b', expected: 'B' },
684
731
  { param: 'c', expected: 'C' }
685
732
  ].forEach(function (data) {
686
-
687
- browserUrl.change('?sap-ui-legacy-date-format=' + encodeURIComponent(data.param));
688
- oSpySetLegacyDateFormat.resetHistory();
733
+ // setup
734
+ oStub && oStub.restore();
735
+ oStub = sinon.stub(BaseConfig, "get");
736
+ oStub.callsFake(function(mParameters) {
737
+ if (mParameters.name === "sapUiLegacyDateFormat") {
738
+ return data.param;
739
+ } else {
740
+ return oStub.wrappedMethod.call(this, mParameters);
741
+ }
742
+ }.bind(this));
689
743
 
690
744
  Configuration.setCore();
691
745
 
692
- assert.equal(oSpySetLegacyDateFormat.callCount, 1, "setLegacyDateFormat must have been called one time");
693
746
  assert.equal(Configuration.getFormatSettings().getLegacyDateFormat(), data.expected, "Value of date format must be '" + data.expected + "'.");
694
747
  });
748
+ oStub.restore();
695
749
  });
696
750
 
697
751
  QUnit.test("Read 'sap-ui-legacy-time-format' from URL", function(assert) {
698
- var oSpySetLegacyTimeFormat = this.spy(Configuration.FormatSettings.prototype, "setLegacyTimeFormat");
752
+ var oStub, oBaseStub;
699
753
 
700
754
  [
701
755
  { param: '', expected: undefined },
@@ -705,29 +759,52 @@ sap.ui.require([
705
759
  { param: '3', expected: '3' },
706
760
  { param: '4', expected: '4' }
707
761
  ].forEach(function (data) {
708
-
709
- browserUrl.change('?sap-ui-legacy-time-format=' + encodeURIComponent(data.param));
710
- oSpySetLegacyTimeFormat.resetHistory();
762
+ // setup
763
+ oStub && oStub.restore();
764
+ oStub = sinon.stub(URLConfigurationProvider, "get");
765
+ oStub.callsFake(function(key) {
766
+ if (key === "sapUiLegacyTimeFormat") {
767
+ return data.param;
768
+ } else {
769
+ return oStub.wrappedMethod.call(this, key);
770
+ }
771
+ }.bind(this));
772
+ //reset memory Provider
773
+ oBaseStub && oBaseStub.restore();
774
+ oBaseStub = sinon.stub(BaseConfig, "get");
775
+ oBaseStub.callsFake(function(mParameters) {
776
+ mParameters.provider = undefined;
777
+ return oBaseStub.wrappedMethod.call(this, mParameters);
778
+ }.bind(this));
711
779
 
712
780
  Configuration.setCore();
713
781
 
714
- assert.equal(oSpySetLegacyTimeFormat.callCount, 1, "setLegacyTimeFormat must be called one time");
715
782
  assert.equal(Configuration.getFormatSettings().getLegacyTimeFormat(), data.expected, "Value of time format must be '" + data.expected + "'.");
716
783
  });
784
+ oStub.restore();
785
+ oBaseStub.restore();
717
786
  });
718
787
 
719
788
  QUnit.module("CalendarWeekNumbering", {
720
- beforeEach: function(assert) {
721
- window["sap-ui-config"].language = "en";
722
- },
723
- afterEach: function() {
724
- browserUrl.reset();
725
- }
789
+
726
790
  });
727
791
 
728
792
  QUnit.test("Read calendarWeekNumbering from URL", function(assert) {
729
793
  // setup
730
- browserUrl.change('?sap-ui-calendarWeekNumbering=ISO_8601');
794
+ var oStub = sinon.stub(URLConfigurationProvider, "get");
795
+ oStub.callsFake(function(key) {
796
+ if (key === "sapUiCalendarWeekNumbering") {
797
+ return "ISO_8601";
798
+ } else {
799
+ return oStub.wrappedMethod.call(this, key);
800
+ }
801
+ }.bind(this));
802
+ //reset memory Provider
803
+ var oBaseStub = sinon.stub(BaseConfig, "get");
804
+ oBaseStub.callsFake(function(mParameters) {
805
+ mParameters.provider = undefined;
806
+ return oBaseStub.wrappedMethod.call(this, mParameters);
807
+ }.bind(this));
731
808
 
732
809
  // call method under test
733
810
  Configuration.setCore();
@@ -735,11 +812,26 @@ sap.ui.require([
735
812
  // verify results
736
813
  assert.equal(Configuration.getCalendarWeekNumbering(), CalendarWeekNumbering.ISO_8601,
737
814
  'calendarWeekNumbering set via URL');
815
+ oStub.restore();
816
+ oBaseStub.restore();
738
817
  });
739
818
 
740
819
  QUnit.test("Read calendarWeekNumbering from URL - empty string leads to default value", function(assert) {
741
820
  // setup
742
- browserUrl.change('?sap-ui-calendarWeekNumbering=');
821
+ var oStub = sinon.stub(URLConfigurationProvider, "get");
822
+ oStub.callsFake(function(key) {
823
+ if (key === "sapUiCalendarWeekNumbering") {
824
+ return "";
825
+ } else {
826
+ return oStub.wrappedMethod.call(this, key);
827
+ }
828
+ }.bind(this));
829
+ //reset memory Provider
830
+ var oBaseStub = sinon.stub(BaseConfig, "get");
831
+ oBaseStub.callsFake(function(mParameters) {
832
+ mParameters.provider = undefined;
833
+ return oBaseStub.wrappedMethod.call(this, mParameters);
834
+ }.bind(this));
743
835
 
744
836
  // call method under test
745
837
  Configuration.setCore();
@@ -747,88 +839,70 @@ sap.ui.require([
747
839
  // verify results
748
840
  assert.equal(Configuration.getCalendarWeekNumbering(), CalendarWeekNumbering.Default,
749
841
  'no value in URL leads to default value');
842
+ oStub.restore();
843
+ oBaseStub.restore();
750
844
  });
751
845
 
752
846
  QUnit.test("Read calendarWeekNumbering from URL - invalid value", function(assert) {
753
- // setup
754
- browserUrl.change('?sap-ui-calendarWeekNumbering=invalid');
755
-
756
- // call method under test
757
847
  assert.throws(function() {
758
- Configuration.setCore();
759
- }, new Error("Unsupported Enumeration value for calendarWeekNumbering, valid values are: "
848
+ Configuration.setCalendarWeekNumbering("invalid");
849
+ }, new TypeError("Unsupported Enumeration value for calendarWeekNumbering, valid values are: "
760
850
  + "Default, ISO_8601, MiddleEastern, WesternTraditional"));
761
851
  });
762
852
 
763
853
  QUnit.module("Timezone", {
764
854
  beforeEach: function(assert) {
765
- window["sap-ui-config"].language = "en";
766
- },
767
- afterEach: function() {
768
- browserUrl.reset();
855
+ Configuration.setLanguage("en");
769
856
  }
770
857
  });
771
858
 
772
859
  QUnit.test("Read timezone from URL", function(assert) {
773
860
  // setup
774
- browserUrl.change('?sap-ui-timezone=America/Los_Angeles');
775
-
776
- // call method under test
777
- Configuration.setCore();
861
+ var oStub = sinon.stub(BaseConfig, "get");
862
+ oStub.callsFake(function(mParameters) {
863
+ if (mParameters.name === "sapUiTimezone") {
864
+ return "America/Los_Angeles";
865
+ } else {
866
+ return oStub.wrappedMethod.call(this, mParameters);
867
+ }
868
+ });
778
869
 
779
870
  // verify results
780
871
  assert.equal(Configuration.getTimezone(), 'America/Los_Angeles', 'America/Los_Angeles is set');
872
+ oStub.restore();
781
873
  });
782
874
 
783
875
  QUnit.test("Read timezone from URL sap-timezone", function(assert) {
784
- // setup
785
- browserUrl.change('?sap-timezone=America/Los_Angeles');
786
-
787
- // call method under test
788
- Configuration.setCore();
876
+ var oStub = sinon.stub(BaseConfig, "get");
877
+ oStub.callsFake(function(mParameters) {
878
+ if (mParameters.name === "sapTimezone") {
879
+ return "America/Los_Angeles";
880
+ } else {
881
+ return oStub.wrappedMethod.call(this, mParameters);
882
+ }
883
+ });
789
884
 
790
885
  // verify results
791
886
  assert.equal(Configuration.getTimezone(), 'America/Los_Angeles', 'America/Los_Angeles is set');
792
-
793
- // repeat the test with an invalid timezone to reset _experimentalTimezone flag before executing other tests
794
- // setup
795
- browserUrl.change('?sap-timezone=invalid');
796
-
797
- // call method under test
798
- Configuration.setCore();
799
-
800
- // verify results
801
- assert.equal(Configuration.getTimezone(), sLocalTimezone, "fallback to '" + sLocalTimezone + "'");
887
+ oStub.restore();
802
888
  });
803
889
 
804
- QUnit.module("SAP parameters", {
805
- beforeEach: function(assert) {
806
- window["sap-ui-config"].language = "en";
807
- },
808
- afterEach: function() {
809
- browserUrl.reset();
810
- }
811
- });
812
-
813
- QUnit.test("Set SAPLogonLanguage and SAP parameter is updated", function(assert) {
814
-
890
+ QUnit.test("Read timezone from URL: invalid", function(assert) {
815
891
  // setup
816
- browserUrl.change('?sap-language=EN');
817
-
818
- // call method under test
819
- Configuration.setCore();
892
+ var oStub = sinon.stub(BaseConfig, "get");
893
+ oStub.callsFake(function(mParameters) {
894
+ if (mParameters.name === "sapUiTimezone") {
895
+ return "invalid";
896
+ } else {
897
+ return oStub.wrappedMethod.call(this, mParameters);
898
+ }
899
+ });
820
900
 
821
901
  // verify results
822
- assert.equal(Configuration.getSAPLogonLanguage(), 'EN', 'SAP parameter sap-language=EN');
823
- Configuration.setLanguage("es");
824
- assert.equal(Configuration.getSAPLogonLanguage(), 'ES', 'SAP parameter sap-language=ES');
825
-
826
-
902
+ assert.equal(Configuration.getTimezone(), sLocalTimezone, "fallback to '" + sLocalTimezone + "'");
903
+ oStub.restore();
827
904
  });
828
905
 
829
- // "animationmode" is the normalized value, the application still needs to use "animationMode".
830
- var sAnimationModeConfigurationName = 'animationmode';
831
-
832
906
  /**
833
907
  * Tests the interaction between the legacy "animation" and the modern "animationMode" settings.
834
908
  * If only the legacy "animation" settings is given, the modern "animationMode" settings is
@@ -837,29 +911,42 @@ sap.ui.require([
837
911
  */
838
912
  QUnit.module("[Legacy] Animation & AnimationMode interaction", {
839
913
  beforeEach: function() {
840
- window['sap-ui-config'] = window["sap-ui-config"] || {};
841
- delete window["sap-ui-config"]['animation'];
842
- delete window["sap-ui-config"][sAnimationModeConfigurationName];
914
+ this.mParams = {};
915
+ this.oGlobalConfigStub = sinon.stub(GlobalConfigurationProvider, "get");
916
+ this.oGlobalConfigStub.callsFake(function(sKey) {
917
+ if (this.mParams[sKey] !== undefined) {
918
+ return this.mParams[sKey];
919
+ } else {
920
+ return this.oGlobalConfigStub.wrappedMethod.call(this, sKey);
921
+ }
922
+ }.bind(this));
923
+ this.oBaseStub = sinon.stub(BaseConfig, "get");
924
+ this.oBaseStub.callsFake(function(mParameters) {
925
+ mParameters.provider = undefined;
926
+ return this.oBaseStub.wrappedMethod.call(this, mParameters);
927
+ }.bind(this));
928
+ },
929
+ afterEach: function() {
930
+ this.oGlobalConfigStub.restore();
931
+ this.oBaseStub.restore();
843
932
  }
844
933
  });
845
934
 
846
935
  QUnit.test("Default animation and animation mode", function(assert) {
847
- Configuration.setCore();
848
936
  assert.ok(Configuration.getAnimation(), "Default animation.");
849
937
  assert.equal(Configuration.getAnimationMode(), AnimationMode.full, "Default animation mode.");
850
938
  });
851
939
 
852
940
  QUnit.test("Animation is off, default animation mode", function(assert) {
853
- window['sap-ui-config'] = { animation: false };
854
- Configuration.setCore();
941
+ this.mParams.sapUiAnimation = false;
942
+ this.mParams.sapUiAnimationMode = undefined;
855
943
  assert.ok(!Configuration.getAnimation(), "Animation should be off.");
856
944
  assert.equal(Configuration.getAnimationMode(), AnimationMode.minimal, "Animation mode should switch to " + AnimationMode.minimal + ".");
857
945
  });
858
946
 
859
947
  QUnit.test("Animation is off, valid but not possible mode is set and sanitized", function(assert) {
860
- window['sap-ui-config']['animation'] = false;
861
- window['sap-ui-config'][sAnimationModeConfigurationName] = AnimationMode.basic;
862
- Configuration.setCore();
948
+ this.mParams.sapUiAnimation = false;
949
+ this.mParams.sapUiAnimationMode = AnimationMode.basic;
863
950
  assert.ok(Configuration.getAnimation(), "Animation should be on because animation mode overwrites animation.");
864
951
  assert.equal(Configuration.getAnimationMode(), AnimationMode.basic, "Animation mode should switch to " + AnimationMode.basic + ".");
865
952
  });
@@ -868,8 +955,8 @@ sap.ui.require([
868
955
  for (var sAnimationModeKey in AnimationMode) {
869
956
  if (AnimationMode.hasOwnProperty(sAnimationModeKey)) {
870
957
  var sAnimationMode = AnimationMode[sAnimationModeKey];
871
- window['sap-ui-config'][sAnimationModeConfigurationName] = sAnimationMode;
872
- Configuration.setCore();
958
+ this.mParams.sapUiAnimation = false;
959
+ this.mParams.sapUiAnimationMode = sAnimationMode;
873
960
  if (sAnimationMode === AnimationMode.none || sAnimationMode === AnimationMode.minimal) {
874
961
  assert.ok(!Configuration.getAnimation(), "Animation is switched to off because of animation mode.");
875
962
  } else {
@@ -880,13 +967,38 @@ sap.ui.require([
880
967
  }
881
968
  });
882
969
 
883
- QUnit.module("AnimationMode initial setting evaluation");
970
+ QUnit.module("AnimationMode initial setting evaluation", {
971
+ beforeEach: function() {
972
+ this.mParams = {};
973
+ this.oGlobalConfigStub = sinon.stub(GlobalConfigurationProvider, "get");
974
+ this.oGlobalConfigStub.callsFake(function(sKey) {
975
+ if (this.mParams[sKey] !== undefined) {
976
+ return this.mParams[sKey];
977
+ } else {
978
+ return this.oGlobalConfigStub.wrappedMethod.call(this, sKey);
979
+ }
980
+ }.bind(this));
981
+ this.oBaseStub = sinon.stub(BaseConfig, "get");
982
+ this.oBaseStub.callsFake(function(mParameters) {
983
+ mParameters.provider = undefined;
984
+ return this.oBaseStub.wrappedMethod.call(this, mParameters);
985
+ }.bind(this));
986
+ },
987
+ afterEach: function() {
988
+ this.oGlobalConfigStub.restore();
989
+ this.oBaseStub.restore();
990
+ }
991
+ });
884
992
 
885
993
  QUnit.test("Invalid animation mode", function(assert) {
886
- window['sap-ui-config'][sAnimationModeConfigurationName] = "someuUnsupportedStringValue";
994
+ /**
995
+ * @deprecated As of version 1.50.0, replaced by {@link sap.ui.core.Configuration#getAnimationMode}
996
+ */
997
+ this.mParams.sapUiAnimation = false;
998
+ this.mParams.sapUiAnimationMode = "someuUnsupportedStringValue";
887
999
  assert.throws(
888
- function() { Configuration.setCore(); },
889
- new Error("Unsupported Enumeration value for animationMode, valid values are: full, basic, minimal, none"),
1000
+ function() { Configuration.getAnimationMode(); },
1001
+ new TypeError("Unsupported Enumeration value for sapUiAnimationMode, valid values are: full, basic, minimal, none"),
890
1002
  "Unsupported value for animation mode should throw an error."
891
1003
  );
892
1004
  });
@@ -895,8 +1007,11 @@ sap.ui.require([
895
1007
  for (var sAnimationModeKey in AnimationMode) {
896
1008
  if (AnimationMode.hasOwnProperty(sAnimationModeKey)) {
897
1009
  var sAnimationMode = AnimationMode[sAnimationModeKey];
898
- window['sap-ui-config'][sAnimationModeConfigurationName] = sAnimationMode;
899
- Configuration.setCore();
1010
+ /**
1011
+ * @deprecated As of version 1.50.0, replaced by {@link sap.ui.core.Configuration#getAnimationMode}
1012
+ */
1013
+ this.mParams.sapUiAnimation = false;
1014
+ this.mParams.sapUiAnimationMode = sAnimationMode;
900
1015
  assert.equal(Configuration.getAnimationMode(), sAnimationMode, "Test for animation mode: " + sAnimationMode);
901
1016
  }
902
1017
  }
@@ -904,15 +1019,16 @@ sap.ui.require([
904
1019
 
905
1020
  QUnit.module("AnimationMode changes at runtime", {
906
1021
  before: function () {
907
- window["sap-ui-config"] = {};
908
- Configuration.setCore(oRealCore);
909
1022
  this.getConfiguration = function () {
910
1023
  return Configuration;
911
1024
  };
912
1025
  },
913
- afterEach: function() {
1026
+ beforeEach: function() {
914
1027
  // Restore default animation mode
915
1028
  Configuration.setAnimationMode(AnimationMode.full);
1029
+ },
1030
+ afterEach: function() {
1031
+ Configuration.setAnimationMode(AnimationMode.minimal);
916
1032
  }
917
1033
  });
918
1034
 
@@ -933,12 +1049,18 @@ sap.ui.require([
933
1049
  // Check if default values are set
934
1050
  assert.equal(oConfiguration.getAnimationMode(), AnimationMode.full, "Default animation mode is " + AnimationMode.full + ".");
935
1051
  assert.equal(getHtmlAttribute("data-sap-ui-animation-mode"), AnimationMode.full, "Default animation mode should be injected as attribute.");
1052
+ /**
1053
+ * @deprecated As of version 1.50.0, replaced by {@link sap.ui.core.Configuration#getAnimationMode}
1054
+ */
936
1055
  assert.equal(getHtmlAttribute("data-sap-ui-animation"), "on", "Default animation should be injected as attribute.");
937
1056
 
938
1057
  // Change animation mode
939
1058
  oConfiguration.setAnimationMode(AnimationMode.none);
940
1059
  assert.equal(oConfiguration.getAnimationMode(), AnimationMode.none, "Animation mode should switch to " + AnimationMode.none + ".");
941
1060
  assert.equal(getHtmlAttribute("data-sap-ui-animation-mode"), AnimationMode.none, "Animation mode should be injected as attribute.");
1061
+ /**
1062
+ * @deprecated As of version 1.50.0, replaced by {@link sap.ui.core.Configuration#getAnimationMode}
1063
+ */
942
1064
  assert.equal(getHtmlAttribute("data-sap-ui-animation"), "off", "Animation should be turned off.");
943
1065
  });
944
1066
 
@@ -947,7 +1069,7 @@ sap.ui.require([
947
1069
 
948
1070
  assert.throws(
949
1071
  function() { oConfiguration.setAnimationMode("someUnsupportedStringValue"); },
950
- new Error("Unsupported Enumeration value for animationMode, valid values are: full, basic, minimal, none"),
1072
+ new TypeError("Unsupported Enumeration value for animationMode, valid values are: full, basic, minimal, none"),
951
1073
  "Unsupported value for animation mode should throw an error."
952
1074
  );
953
1075
 
@@ -1056,120 +1178,132 @@ sap.ui.require([
1056
1178
  assert.equal(_getNumberOfFlModules(Configuration), 1);
1057
1179
  });
1058
1180
 
1059
- QUnit.module("ThemeRoot Validation", {
1060
- before: HistoryUtils.check
1061
- });
1181
+ QUnit.module("ThemeRoot Validation");
1062
1182
 
1063
1183
  [
1064
1184
  {
1065
1185
  caption: "Relative URL, All Origins",
1066
- url: location.origin + "?sap-theme=custom@custom-theme/",
1186
+ theme: "custom@custom-theme/",
1067
1187
  allowedOrigins: "*",
1068
- expectedThemeRoot: location.origin + "/custom-theme/UI5/"
1188
+ expectedThemeRoot: "custom-theme/UI5/"
1069
1189
  },
1070
1190
  {
1071
1191
  caption: "Relative URL, no valid origins",
1072
- url: location.origin + "?sap-theme=custom@custom-theme/",
1192
+ theme: "custom@custom-theme/",
1073
1193
  allowedOrigins: null,
1074
- expectedThemeRoot: location.origin + "/custom-theme/UI5/"
1194
+ expectedThemeRoot: "custom-theme/UI5/"
1075
1195
  },
1076
1196
  {
1077
1197
  caption: "Relative URL, baseURI on different domain, no valid origins",
1078
- url: location.origin + "?sap-theme=custom@custom-theme/",
1198
+ theme: "custom@custom-theme/",
1079
1199
  allowedOrigins: null,
1080
- expectedThemeRoot: location.origin + "/custom-theme/UI5/",
1081
- baseURI: "http://example.org"
1200
+ expectedThemeRoot: "custom-theme/UI5/",
1201
+ baseURI: "http://example.org" //Check why needed
1082
1202
  },
1083
1203
  {
1084
1204
  caption: "Relative URL, baseURI on different domain, All origins",
1085
- url: location.origin + "?sap-theme=custom@custom-theme/",
1205
+ theme: "custom@custom-theme/",
1086
1206
  allowedOrigins: "*",
1087
- expectedThemeRoot: location.origin + "/custom-theme/UI5/",
1088
- baseURI: "http://example.org"
1207
+ expectedThemeRoot: "custom-theme/UI5/",
1208
+ baseURI: "http://example.org" //Check why needed
1089
1209
  },
1090
1210
  {
1091
1211
  caption: "Relative URL, relative baseURI",
1092
- url: location.origin + "/foo/bar/?sap-theme=custom@../custom-theme",
1212
+ theme: "custom@../custom-theme",
1093
1213
  allowedOrigins: null,
1094
- expectedThemeRoot: location.origin + "/foo/custom-theme/UI5/",
1095
- baseURI: "/some/other/path/"
1214
+ expectedThemeRoot: "../custom-theme/UI5/",
1215
+ baseURI: "/some/other/path/" //Check why needed
1096
1216
  },
1097
1217
  {
1098
1218
  caption: "Absolute URL, All Origins",
1099
- url: location.origin + "?sap-theme=custom@ftp://example.org/theming/custom-theme/",
1219
+ theme: "custom@ftp://example.org/theming/custom-theme/",
1100
1220
  allowedOrigins: "*",
1101
1221
  expectedThemeRoot: "ftp://example.org/theming/custom-theme/UI5/"
1102
1222
  },
1103
1223
  {
1104
1224
  caption: "Absolute URL, Same Domain",
1105
- url: location.origin + "?sap-theme=custom@" + location.origin + "/theming/custom-theme/",
1225
+ theme: "custom@" + location.origin + "/theming/custom-theme/",
1106
1226
  allowedOrigins: location.origin,
1107
- expectedThemeRoot: location.origin + "/theming/custom-theme/UI5/"
1227
+ expectedThemeRoot: "/theming/custom-theme/UI5/"
1108
1228
  },
1109
1229
  {
1110
1230
  caption: "Absolute URL, Valid, but Different Domain",
1111
- url: location.origin + "?sap-theme=custom@https://example.com/theming/custom-theme/",
1231
+ theme: "custom@https://example.com/theming/custom-theme/",
1112
1232
  allowedOrigins: "https://example.com",
1113
1233
  expectedThemeRoot: "https://example.com/theming/custom-theme/UI5/"
1114
1234
  },
1115
1235
  {
1116
1236
  caption: "Absolute URL, no valid origins",
1117
- url: location.origin + "?sap-theme=custom@https://example.com/theming/custom-theme/",
1237
+ theme: "custom@https://example.com/theming/custom-theme/",
1118
1238
  allowedOrigins: null,
1119
- expectedThemeRoot: location.origin + "/theming/custom-theme/UI5/"
1239
+ expectedThemeRoot: "/theming/custom-theme/UI5/"
1120
1240
  },
1121
1241
  {
1122
1242
  caption: "Absolute URL, empty valid origins",
1123
- url: location.origin + "?sap-theme=custom@https://example.com/theming/custom-theme/",
1243
+ theme: "custom@https://example.com/theming/custom-theme/",
1124
1244
  allowedOrigins: "",
1125
- expectedThemeRoot: location.origin + "/theming/custom-theme/UI5/"
1245
+ expectedThemeRoot: "/theming/custom-theme/UI5/"
1126
1246
  },
1127
1247
  {
1128
1248
  caption: "Absolute URL with same protocol, Valid",
1129
- url: location.origin + "?sap-theme=custom@//example.com/theming/custom-theme/",
1249
+ theme: "custom@//example.com/theming/custom-theme/",
1130
1250
  allowedOrigins: "example.com",
1131
- expectedThemeRoot: "//example.com/theming/custom-theme/UI5/"
1251
+ expectedThemeRoot: "//example.com/theming/custom-theme/UI5/",
1252
+ noProtocol: true
1253
+ },
1254
+ {
1255
+ caption: "Absolute URL with same protocol and themeRoot has default port, Valid",
1256
+ theme: "custom@//example.com:80/theming/custom-theme/",
1257
+ allowedOrigins: "example.com",
1258
+ expectedThemeRoot: "//example.com/theming/custom-theme/UI5/",
1259
+ noProtocol: true
1260
+ },
1261
+ {
1262
+ caption: "Absolute URL with same protocol and allowedThemeOrigin has default port, Valid",
1263
+ theme: "custom@//example.com/theming/custom-theme/",
1264
+ allowedOrigins: "example.com:80",
1265
+ expectedThemeRoot: "//example.com/theming/custom-theme/UI5/",
1266
+ noProtocol: true
1267
+ },
1268
+ {
1269
+ caption: "Absolute URL with same protocol and custom port, Valid",
1270
+ theme: "custom@//example.com:8080/theming/custom-theme/",
1271
+ allowedOrigins: "example.com:8080",
1272
+ expectedThemeRoot: "//example.com:8080/theming/custom-theme/UI5/",
1273
+ noProtocol: true
1274
+ },
1275
+ {
1276
+ caption: "Absolute URL with same protocol and themeRoot has custom port, not valid",
1277
+ theme: "custom@//example.com:8080/theming/custom-theme/",
1278
+ allowedOrigins: "example.com",
1279
+ expectedThemeRoot: location.origin.replace(location.protocol, "") + "/theming/custom-theme/UI5/",
1280
+ noProtocol: true
1281
+ },
1282
+ {
1283
+ caption: "Absolute URL with same protocol and allowedThemeOrigin has custom port, not valid",
1284
+ theme: "custom@//example.com/theming/custom-theme/",
1285
+ allowedOrigins: "example.com:8080",
1286
+ expectedThemeRoot: location.origin.replace(location.protocol, "") + "/theming/custom-theme/UI5/",
1287
+ noProtocol: true
1132
1288
  }
1133
1289
  ].forEach(function(oSetup) {
1134
-
1135
1290
  QUnit.test(oSetup.caption, function(assert) {
1136
- var oMeta = null, oBase = null, sExistingBaseHref;
1137
- browserUrl.change(oSetup.url);
1138
- if ( oSetup.allowedOrigins != null ) {
1139
- oMeta = document.createElement("meta");
1140
- oMeta.setAttribute("name", "sap-allowedThemeOrigins");
1141
- oMeta.setAttribute("content", oSetup.allowedOrigins);
1142
- document.head.appendChild(oMeta);
1143
- }
1144
- if ( oSetup.baseURI != null ) {
1145
- oBase = document.querySelector("base");
1146
- if (oBase) {
1147
- sExistingBaseHref = oBase.getAttribute("href");
1148
- } else {
1149
- oBase = document.createElement("base");
1150
- document.head.appendChild(oBase);
1151
- }
1152
- oBase.setAttribute("href", oSetup.baseURI);
1153
- }
1154
- try {
1155
- Configuration.setCore(oRealCore);
1156
- assert.equal(Configuration.getTheme(), "custom", "Configuration 'theme'");
1157
- assert.equal(Configuration.getThemeRoot(), oSetup.expectedThemeRoot, "Configuration 'themeRoot'");
1158
- } finally {
1159
- browserUrl.reset();
1160
- if ( oMeta ) {
1161
- document.head.removeChild(oMeta);
1162
- }
1163
- if ( oBase ) {
1164
- if ( sExistingBaseHref ) {
1165
- oBase.setAttribute("href", sExistingBaseHref);
1166
- } else {
1167
- document.head.removeChild(oBase);
1168
- }
1291
+ var oStub = sinon.stub(BaseConfig, "get");
1292
+ oStub.callsFake(function(mParameters) {
1293
+ switch (mParameters.name) {
1294
+ case "sapAllowedThemeOrigins":
1295
+ return oSetup.allowedOrigins;
1296
+ case "sapUiTheme":
1297
+ return oSetup.theme;
1298
+ default:
1299
+ return oStub.wrappedMethod.call(this, mParameters);
1169
1300
  }
1170
- }
1301
+ });
1302
+ assert.equal(Theming.getTheme(), "custom", "Configuration 'getTheme' returns expected 'theme' " + Theming.getTheme());
1303
+ assert.equal(Theming.getThemeRoot(), oSetup.noProtocol ? oSetup.expectedThemeRoot : new URL(oSetup.expectedThemeRoot, location.href).toString(),
1304
+ "Theming 'getThemeRoot' returns expected 'themeRoot' " + Theming.getThemeRoot());
1305
+ oStub.restore();
1171
1306
  });
1172
-
1173
1307
  });
1174
1308
 
1175
1309
  /*