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

Side by Side Diff: chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm

Issue 968263005: [Mac] Cleans up the StatusBubbleMac code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review. Created 5 years, 9 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/status_bubble_mac.mm ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <Cocoa/Cocoa.h> 5 #include <Cocoa/Cocoa.h>
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 int windowWidth = NSWidth([window frame]); 660 int windowWidth = NSWidth([window frame]);
661 for (int x = 0; x < windowWidth; x += smallValue) { 661 for (int x = 0; x < windowWidth; x += smallValue) {
662 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); 662 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue));
663 } 663 }
664 664
665 // Simulate moving the mouse from right to left. 665 // Simulate moving the mouse from right to left.
666 for (int x = windowWidth; x >= 0; x -= smallValue) { 666 for (int x = windowWidth; x >= 0; x -= smallValue) {
667 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); 667 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue));
668 } 668 }
669 } 669 }
670
671 TEST_F(StatusBubbleMacTest, ReparentBubble) {
672 // The second window is borderless, like the window used in fullscreen mode.
673 base::scoped_nsobject<NSWindow> fullscreenParent(
674 [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
675 styleMask:NSBorderlessWindowMask
676 backing:NSBackingStoreBuffered
677 defer:NO]);
678
679 // Switch parents with the bubble hidden.
680 bubble_->SwitchParentWindow(fullscreenParent);
681
682 // Switch back to the original parent with the bubble showing.
683 bubble_->SetStatus(UTF8ToUTF16("Showing"));
684 bubble_->SwitchParentWindow(test_window());
685 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698