Refs #1355. Manual window title test.

In the PlatformWindows test, change the window title both when theWindow is a non platform window and when it is a platform window to verify that the browser window title changes only when it should.
This commit is contained in:
Alexander Ljungberg committed 2011-09-17 11:07:38 +01:00
1 parent c8991e07b9
commit 4aec3f7466
1 file changed
+25 -23
+25 -23
View File
@@ -37,44 +37,46 @@
platformWindow = [[CPPlatformWindow alloc] init];
// [platformWindow orderFront:self];//console.log(CPStringFromRect([theWindow contentRectForFrameRect:[theWindow frame]]));
// [platformWindow orderFront:self];//console.log(CPStringFromRect([theWindow contentRectForFrameRect:[theWindow frame]]));
[platformWindow setContentRect:[theWindow contentRectForFrameRect:[theWindow frame]]];
// [theWindow setTitle:@"My Custom Title"];
//[platformWindow orderFront:self];
// seriously, this test file is dirty :)
var slider = [[theWindow contentView] subviews][0];
[slider setTarget:self];
[slider setAction:@selector(randomTitle:)];
[slider setContinuous:NO];
window.setTimeout(function(){
[theWindow orderOut:self];
[theWindow setPlatformWindow:platformWindow];
[theWindow orderFront:self];
[theWindow setFullBridge:YES];
var button = [[theWindow contentView] subviews][2];
[theWindow setTitle:"Initial title (pop out pending)"];
window.setTimeout(function()
{
[theWindow orderOut:self];
[theWindow setPlatformWindow:platformWindow];
[theWindow orderFront:self];
[theWindow setFullBridge:YES];
var button = [[theWindow contentView] subviews][2];
[button setTarget:self];
[button setAction:@selector(close)];
[button setTarget:self];
[button setAction:@selector(close)];
[theWindow setTitle:"Title after pop out (red box pending)"];
window.setTimeout(function(){
var view = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
[view setBackgroundColor:[CPColor redColor]];
[[theWindow contentView] addSubview:view];},1000);
}, 1000);
//window.setTimeout(function() { [platformWindow orderOut:self]; [platformWindow orderFront:self]; }, 2000);
window.setTimeout(function()
{
var view = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
[view setBackgroundColor:[CPColor redColor]];
[[theWindow contentView] addSubview:view];
[theWindow setTitle:"Title in final stage"];
}, 1000);
}, 2000);
}
- (void)close
{
[[theWindow platformWindow] orderOut:self];
window.setTimeout(function(){
[[theWindow platformWindow] orderFront:self];}, 1000);
window.setTimeout(function()
{
[[theWindow platformWindow] orderFront:self];
}, 1000);
}
- (void)another:(id)aSender
@@ -84,7 +86,7 @@ window.setTimeout(function(){
- (IBAction)randomTitle:(id)aSender
{
[theWindow setTitle:@"Window random number " + Math.random(1000)]
[theWindow setTitle:@"Window random number " + Math.random(1000)];
}
@end