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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_controller_unittest.mm

Issue 7461134: [Mac] Unspoofable infobars v3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 4 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 | 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return self; 47 return self;
48 } 48 }
49 49
50 - (void)willRemoveController:(InfoBarController*)controller { 50 - (void)willRemoveController:(InfoBarController*)controller {
51 } 51 }
52 52
53 - (void)removeController:(InfoBarController*)controller { 53 - (void)removeController:(InfoBarController*)controller {
54 DCHECK(controller_ == controller); 54 DCHECK(controller_ == controller);
55 controller_ = nil; 55 controller_ = nil;
56 } 56 }
57
58 - (BrowserWindowController*)browserWindowController {
59 return nil;
60 }
57 @end 61 @end
58 62
59 // Calls to removeSelf normally start an animation, which removes the infobar 63 // Calls to removeSelf normally start an animation, which removes the infobar
60 // completely when finished. For testing purposes, we create a mock controller 64 // completely when finished. For testing purposes, we create a mock controller
61 // which calls close: immediately, rather than kicking off an animation. 65 // which calls close: immediately, rather than kicking off an animation.
62 @interface TestLinkInfoBarController : LinkInfoBarController 66 @interface TestLinkInfoBarController : LinkInfoBarController
63 - (void)removeSelf; 67 - (void)removeSelf;
64 @end 68 @end
65 69
66 @implementation TestLinkInfoBarController 70 @implementation TestLinkInfoBarController
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 const CGFloat width = 20; 314 const CGFloat width = 20;
311 NSRect newViewFrame = [[controller_ view] frame]; 315 NSRect newViewFrame = [[controller_ view] frame];
312 newViewFrame.size.width += width; 316 newViewFrame.size.width += width;
313 [[controller_ view] setFrame:newViewFrame]; 317 [[controller_ view] setFrame:newViewFrame];
314 318
315 NSRect newLabelFrame = [controller_ labelFrame]; 319 NSRect newLabelFrame = [controller_ labelFrame];
316 EXPECT_EQ(NSWidth(newLabelFrame), NSWidth(originalLabelFrame) + width); 320 EXPECT_EQ(NSWidth(newLabelFrame), NSWidth(originalLabelFrame) + width);
317 } 321 }
318 322
319 } // namespace 323 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/infobar_controller.mm ('k') | chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698