mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-14 14:41:28 +00:00
Fixed: CPApplicationTest setArguments.
Without this change, CPApplicationTest's manipulation of window.location.hash was ignored by CPApplication in recent versions, since CPApp in a unit test normally does not have access to the window object. This change makes it so that CPApp does try to access the window object, even in a unit test scenario (non PLATFORM(DOM)).
This commit is contained in:
@@ -1047,9 +1047,9 @@ CPRunContinuesResponse = -1002;
|
||||
if (!args || args.length == 0)
|
||||
{
|
||||
_args = [];
|
||||
#if PLATFORM(DOM)
|
||||
window.location.hash = @"#";
|
||||
#endif
|
||||
// Don't use if PLATFORM(DOM) here - the unit test fakes window.location so we should play along.
|
||||
if (window && window.location)
|
||||
window.location.hash = @"#";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1064,9 +1064,9 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
var hash = [toEncode componentsJoinedByString:@"/"];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
window.location.hash = @"#" + hash;
|
||||
#endif
|
||||
// Don't use if PLATFORM(DOM) here - the unit test fakes window.location so we should play along.
|
||||
if (window && window.location)
|
||||
window.location.hash = @"#" + hash;
|
||||
}
|
||||
|
||||
- (void)_reloadArguments
|
||||
|
||||
Reference in New Issue
Block a user