Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: ui/views/cocoa/bridged_native_widget_unittest.mm

Issue 1135333002: Suppress -Wpartial-availability warnings that arise from NSWindowDelegate methods only available on… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from thakis. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 // back into fullscreen but get ignored by Cocoa. 481 // back into fullscreen but get ignored by Cocoa.
482 EXPECT_EQ(0, [window ignoredToggleFullScreenCount]); 482 EXPECT_EQ(0, [window ignoredToggleFullScreenCount]);
483 EXPECT_TRUE(bridge()->target_fullscreen_state()); 483 EXPECT_TRUE(bridge()->target_fullscreen_state());
484 [center postNotificationName:NSWindowDidExitFullScreenNotification 484 [center postNotificationName:NSWindowDidExitFullScreenNotification
485 object:window]; 485 object:window];
486 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); 486 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]);
487 EXPECT_FALSE(bridge()->target_fullscreen_state()); 487 EXPECT_FALSE(bridge()->target_fullscreen_state());
488 488
489 // Cocoa follows up with a failure message sent to the NSWindowDelegate (there 489 // Cocoa follows up with a failure message sent to the NSWindowDelegate (there
490 // is no equivalent notification for failure). Called via id so that this 490 // is no equivalent notification for failure). Called via id so that this
491 // compiles on 10.6. 491 // compiles on 10.6.
Nico 2015/05/18 23:45:09 So I think this is the problem. The Right Fix I th
erikchen 2015/05/19 00:35:24 1. I declared the relevant methods in ui/views/coc
492 id window_delegate = [window delegate]; 492 id window_delegate = [window delegate];
493 [window_delegate windowDidFailToEnterFullScreen:window]; 493 [window_delegate performSelector:@selector(windowDidFailToEnterFullScreen:)
494 withObject:window];
494 EXPECT_FALSE(bridge()->target_fullscreen_state()); 495 EXPECT_FALSE(bridge()->target_fullscreen_state());
495 496
496 // Now perform a successful fullscreen operation. 497 // Now perform a successful fullscreen operation.
497 [center postNotificationName:NSWindowWillEnterFullScreenNotification 498 [center postNotificationName:NSWindowWillEnterFullScreenNotification
498 object:window]; 499 object:window];
499 EXPECT_TRUE(bridge()->target_fullscreen_state()); 500 EXPECT_TRUE(bridge()->target_fullscreen_state());
500 [center postNotificationName:NSWindowDidEnterFullScreenNotification 501 [center postNotificationName:NSWindowDidEnterFullScreenNotification
501 object:window]; 502 object:window];
502 EXPECT_TRUE(bridge()->target_fullscreen_state()); 503 EXPECT_TRUE(bridge()->target_fullscreen_state());
503 504
504 // And try to get out. 505 // And try to get out.
505 [center postNotificationName:NSWindowWillExitFullScreenNotification 506 [center postNotificationName:NSWindowWillExitFullScreenNotification
506 object:window]; 507 object:window];
507 EXPECT_FALSE(bridge()->target_fullscreen_state()); 508 EXPECT_FALSE(bridge()->target_fullscreen_state());
508 509
509 // On a failure, Cocoa sends a failure message, but then just dumps the window 510 // On a failure, Cocoa sends a failure message, but then just dumps the window
510 // out of fullscreen anyway (in that order). 511 // out of fullscreen anyway (in that order).
511 [window_delegate windowDidFailToExitFullScreen:window]; 512 [window_delegate performSelector:@selector(windowDidFailToExitFullScreen:)
513 withObject:window];
512 EXPECT_FALSE(bridge()->target_fullscreen_state()); 514 EXPECT_FALSE(bridge()->target_fullscreen_state());
513 [center postNotificationName:NSWindowDidExitFullScreenNotification 515 [center postNotificationName:NSWindowDidExitFullScreenNotification
514 object:window]; 516 object:window];
515 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. 517 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change.
516 EXPECT_FALSE(bridge()->target_fullscreen_state()); 518 EXPECT_FALSE(bridge()->target_fullscreen_state());
517 519
518 widget_->CloseNow(); 520 widget_->CloseNow();
519 } 521 }
520 522
521 } // namespace test 523 } // namespace test
522 } // namespace views 524 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698