| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ui/views/cocoa/bridged_native_widget.h" | 5 #import "ui/views/cocoa/bridged_native_widget.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 // the fullscreen transition to fail. | 453 // the fullscreen transition to fail. |
| 454 TEST_F(BridgedNativeWidgetSimulateFullscreenTest, FailToEnterAndExit) { | 454 TEST_F(BridgedNativeWidgetSimulateFullscreenTest, FailToEnterAndExit) { |
| 455 if (base::mac::IsOSSnowLeopard()) | 455 if (base::mac::IsOSSnowLeopard()) |
| 456 return; | 456 return; |
| 457 | 457 |
| 458 base::scoped_nsobject<NSWindow> owned_window( | 458 base::scoped_nsobject<NSWindow> owned_window( |
| 459 [[BridgedNativeWidgetTestFullScreenWindow alloc] | 459 [[BridgedNativeWidgetTestFullScreenWindow alloc] |
| 460 initWithContentRect:NSMakeRect(50, 50, 400, 300) | 460 initWithContentRect:NSMakeRect(50, 50, 400, 300) |
| 461 styleMask:NSBorderlessWindowMask | 461 styleMask:NSBorderlessWindowMask |
| 462 backing:NSBackingStoreBuffered | 462 backing:NSBackingStoreBuffered |
| 463 defer:YES]); | 463 defer:NO]); |
| 464 [owned_window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject. | 464 [owned_window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject. |
| 465 bridge()->Init(owned_window, init_params_); // Transfers ownership. | 465 bridge()->Init(owned_window, init_params_); // Transfers ownership. |
| 466 | 466 |
| 467 BridgedNativeWidgetTestFullScreenWindow* window = | 467 BridgedNativeWidgetTestFullScreenWindow* window = |
| 468 base::mac::ObjCCastStrict<BridgedNativeWidgetTestFullScreenWindow>( | 468 base::mac::ObjCCastStrict<BridgedNativeWidgetTestFullScreenWindow>( |
| 469 widget_->GetNativeWindow()); | 469 widget_->GetNativeWindow()); |
| 470 widget_->Show(); | 470 widget_->Show(); |
| 471 | 471 |
| 472 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 472 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 473 | 473 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 [center postNotificationName:NSWindowDidExitFullScreenNotification | 515 [center postNotificationName:NSWindowDidExitFullScreenNotification |
| 516 object:window]; | 516 object:window]; |
| 517 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. | 517 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. |
| 518 EXPECT_FALSE(bridge()->target_fullscreen_state()); | 518 EXPECT_FALSE(bridge()->target_fullscreen_state()); |
| 519 | 519 |
| 520 widget_->CloseNow(); | 520 widget_->CloseNow(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } // namespace test | 523 } // namespace test |
| 524 } // namespace views | 524 } // namespace views |
| OLD | NEW |