Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #1317 page engine disposal of PageConfigHelper
PageConfigHelper was instantiated but not disposed in the destructor. the resolve() method of aria.utils.Path class had an inconsistency in description (doc) and implementation ("If not specified, window is used") close #1317
- Loading branch information
lsimone
committed
Oct 20, 2014
1 parent
b7e3c1b
commit 6ad59c8
Showing
5 changed files
with
147 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
test/aria/pageEngine/pageEngine/pageEngineDisposal/DisposalTest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2014 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
Aria.classDefinition({ | ||
$classpath : "test.aria.pageEngine.pageEngine.pageEngineDisposal.DisposalTest", | ||
$dependencies : ["aria.pageEngine.PageEngine", "test.aria.pageEngine.pageEngine.pageEngineDisposal.PageProvider"], | ||
$extends : "aria.jsunit.TestCase", | ||
$prototype : { | ||
|
||
/** | ||
* this test just checks if all the object instantiated by pageEngine and pageProvider are correctly disposed | ||
*/ | ||
testAsyncDisposePageEngine : function () { | ||
var document = Aria.$window.document; | ||
var div = document.createElement("div"); | ||
div.id = "testId"; | ||
document.body.appendChild(div); | ||
|
||
this.pageEngine = new aria.pageEngine.PageEngine(); | ||
this.pageProvider = new test.aria.pageEngine.pageEngine.pageEngineDisposal.PageProvider(); | ||
|
||
var startConfig = { | ||
pageProvider : this.pageProvider, | ||
oncomplete : { | ||
fn : function () { | ||
this.pageEngine.$dispose(); | ||
this.pageProvider.$dispose(); | ||
this.notifyTestEnd('testAsyncDisposePageEngine'); | ||
}, | ||
scope : this | ||
} | ||
}; | ||
|
||
this.pageEngine.start(startConfig); | ||
|
||
} | ||
} | ||
}); |
26 changes: 26 additions & 0 deletions
26
test/aria/pageEngine/pageEngine/pageEngineDisposal/MainLayout.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2014 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
{Template { | ||
$classpath : "test.aria.pageEngine.pageEngine.pageEngineDisposal.MainLayout" | ||
}} | ||
|
||
{macro main ()} | ||
DISPOSAL TEST | ||
{/macro} | ||
|
||
|
||
{/Template} |
51 changes: 51 additions & 0 deletions
51
test/aria/pageEngine/pageEngine/pageEngineDisposal/PageProvider.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2012 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* Fake page processor | ||
*/ | ||
Aria.classDefinition({ | ||
$classpath : "test.aria.pageEngine.pageEngine.pageEngineDisposal.PageProvider", | ||
$implements : ["aria.pageEngine.pageProviders.PageProviderInterface"], | ||
$prototype : { | ||
|
||
/** | ||
* @param {aria.pageEngine.CfgBeans.ExtendedCallback} callback | ||
*/ | ||
loadSiteConfig : function (callback) { | ||
this.$callback(callback.onsuccess, { | ||
containerId : "testId" | ||
}); | ||
}, | ||
|
||
/** | ||
* @param {String} pageId Id of the page | ||
* @param {aria.pageEngine.CfgBeans.ExtendedCallback} callback | ||
*/ | ||
loadPageDefinition : function (pageId, callback) { | ||
this.$callback(callback.onsuccess, { | ||
pageId : "aaa", | ||
pageComposition : { | ||
template : "test.aria.pageEngine.pageEngine.pageEngineDisposal.MainLayout", | ||
placeholders : { | ||
"newsInfo" : { | ||
"contentId" : "pgen_news_and_info" | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
}); |