Merge pull request #1741 from ahankinson/fix-issue1633

Fix for #1633: setRepresentedFilename
This commit is contained in:
Alexander Ljungberg committed 2013-02-10 22:43:15 +00:00
commit fb577f8b70
2 files changed
+21 -2

No files matched your search

+2 -2
View File
@@ -1467,7 +1467,7 @@ CPTexturedBackgroundWindowMask
- (void)setRepresentedFilename:(CPString)aFilePath
{
// FIXME: urls vs filepaths and all.
[self setRepresentedURL:aFilePath];
[self setRepresentedURL:[CPURL URLWithString:aFilePath]];
}
/*!
@@ -1475,7 +1475,7 @@ CPTexturedBackgroundWindowMask
*/
- (CPString)representedFilename
{
return _representedURL;
return [_representedURL absoluteString];
}
/*!
+19
View File
@@ -1,6 +1,7 @@
@import <AppKit/CPWindow.j>
@import <AppKit/_CPBorderlessWindowView.j>
@import <Foundation/CPURL.j>
[CPApplication sharedApplication];
@@ -109,4 +110,22 @@
message:@"nextTextField should be the previous valid key view of contentView"];
}
- (void)testRepresentedFilename
{
/*
representedURL and representedFilename
are drawn from the _representedURL variable.
*/
var aURL = @"http://www.cappuccino-project.org";
[[self window] setRepresentedURL:[CPURL URLWithString:aURL]];
[self assertTrue:[[[self window] representedURL] class] === [CPURL class]];
/*
Test for Issue 1633
Make sure that changing it via setRepresentedFilename doesn't change the type
*/
[[self window] setRepresentedFilename:aURL];
[self assertTrue:[[[self window] representedURL] class] === [CPURL class]];
}
@end