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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm

Issue 8775022: Add Panel::SetPanelBoundsInstantly for all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
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 #import "chrome/browser/ui/panels/panel_browser_window_cocoa.h" 5 #import "chrome/browser/ui/panels/panel_browser_window_cocoa.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Now resize the Panel, see that titlebar follows. 248 // Now resize the Panel, see that titlebar follows.
249 const int kDelta = 153; // random number 249 const int kDelta = 153; // random number
250 gfx::Rect bounds = panel->GetBounds(); 250 gfx::Rect bounds = panel->GetBounds();
251 // Grow panel in a way so that its titlebar moves and grows. 251 // Grow panel in a way so that its titlebar moves and grows.
252 bounds.set_x(bounds.x() - kDelta); 252 bounds.set_x(bounds.x() - kDelta);
253 bounds.set_y(bounds.y() - kDelta); 253 bounds.set_y(bounds.y() - kDelta);
254 bounds.set_width(bounds.width() + kDelta); 254 bounds.set_width(bounds.width() + kDelta);
255 bounds.set_height(bounds.height() + kDelta); 255 bounds.set_height(bounds.height() + kDelta);
256 256
257 PanelAnimatedBoundsObserver bounds_observer(panel); 257 PanelAnimatedBoundsObserver bounds_observer(panel);
258 native_window->SetPanelBounds(bounds); 258 native_window->SetPanelBounds(bounds, true); // use animation.
259 bounds_observer.Wait(); 259 bounds_observer.Wait();
260 260
261 // Verify the panel resized. 261 // Verify the panel resized.
262 NSRect window_frame = [[native_window->controller_ window] frame]; 262 NSRect window_frame = [[native_window->controller_ window] frame];
263 EXPECT_EQ(NSWidth(window_frame), bounds.width()); 263 EXPECT_EQ(NSWidth(window_frame), bounds.width());
264 EXPECT_EQ(NSHeight(window_frame), bounds.height()); 264 EXPECT_EQ(NSHeight(window_frame), bounds.height());
265 265
266 // Verify the titlebar is still on top of regular titlebar. 266 // Verify the titlebar is still on top of regular titlebar.
267 VerifyTitlebarLocation(contentView, titlebar); 267 VerifyTitlebarLocation(contentView, titlebar);
268 268
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; 399 NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0];
400 EXPECT_NSEQ(frontmostWindow, [native_window->controller_ window]); 400 EXPECT_NSEQ(frontmostWindow, [native_window->controller_ window]);
401 401
402 native_window2->ActivatePanel(); 402 native_window2->ActivatePanel();
403 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; 403 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0];
404 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]); 404 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]);
405 405
406 ClosePanelAndWait(panel->browser()); 406 ClosePanelAndWait(panel->browser());
407 ClosePanelAndWait(panel2->browser()); 407 ClosePanelAndWait(panel2->browser());
408 } 408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698