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:
Alexander Ljungberg
2012-12-15 11:50:47 +00:00
parent 252b8f5ca5
commit 848c893b9e
+6 -6
View File
@@ -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