Define profiler constant to fix /jasmine test run

Change-Id: Ie7aa0e1652b02ccbd9d1f3a776a041ecd3e1aa9b
Closes-Bug: 1665539
(cherry picked from commit 0f55a5268f)
This commit is contained in:
Richard Jones 2017-02-17 15:57:17 +11:00 committed by Rob Cresswell
parent 2366fd7a12
commit 09417eb149
1 changed files with 10 additions and 2 deletions

View File

@ -31,12 +31,20 @@
'$provide',
'$windowProvider',
'$httpProvider',
'horizon.dashboard.developer.profiler.headers'
'$injector'
];
function config($provide, $windowProvider, $httpProvider, headers) {
function config($provide, $windowProvider, $httpProvider, $injector) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/developer/profiler/';
$provide.constant('horizon.dashboard.developer.profiler.basePath', path);
// the headers constant is defined by HTML code, which doesn't exist in some
// contexts (eg. jasmine.html), so we need to handle it not being defined at all
var headers = {};
if ($injector.has('horizon.dashboard.developer.profiler.headers')) {
headers = $injector.get('horizon.dashboard.developer.profiler.headers');
}
if (Object.keys(headers).length) {
$httpProvider.interceptors.push(function() {
return {