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

Side by Side Diff: chrome/browser/cocoa/extension_installed_bubble_controller_unittest.mm

Issue 4724005: Add a help bubble pointing to the omnibox when installing an extension with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: xib Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Initialize window without having to calculate tabstrip locations. 134 // Initialize window without having to calculate tabstrip locations.
135 [controller initializeWindow]; 135 [controller initializeWindow];
136 EXPECT_TRUE([controller window]); 136 EXPECT_TRUE([controller window]);
137 137
138 int height = [controller calculateWindowHeight]; 138 int height = [controller calculateWindowHeight];
139 // Height should equal the vertical padding + height of all messages. 139 // Height should equal the vertical padding + height of all messages.
140 int correctHeight = 2 * extension_installed_bubble::kOuterVerticalMargin + 140 int correctHeight = 2 * extension_installed_bubble::kOuterVerticalMargin +
141 2 * extension_installed_bubble::kInnerVerticalMargin + 141 2 * extension_installed_bubble::kInnerVerticalMargin +
142 [controller getExtensionInstalledMsgFrame].size.height + 142 [controller getExtensionInstalledMsgFrame].size.height +
143 [controller getExtensionInstalledInfoMsgFrame].size.height + 143 [controller getExtensionInstalledInfoMsgFrame].size.height +
144 [controller getPageActionInfoMsgFrame].size.height; 144 [controller getExtraInfoMsgFrame].size.height;
145 EXPECT_EQ(height, correctHeight); 145 EXPECT_EQ(height, correctHeight);
146 146
147 [controller setMessageFrames:height]; 147 [controller setMessageFrames:height];
148 NSRect msg3Frame = [controller getExtensionInstalledInfoMsgFrame]; 148 NSRect msg3Frame = [controller getExtensionInstalledInfoMsgFrame];
149 // Bottom message should be kOuterVerticalMargin pixels above window edge. 149 // Bottom message should be kOuterVerticalMargin pixels above window edge.
150 EXPECT_EQ(msg3Frame.origin.y, 150 EXPECT_EQ(msg3Frame.origin.y,
151 extension_installed_bubble::kOuterVerticalMargin); 151 extension_installed_bubble::kOuterVerticalMargin);
152 NSRect msg2Frame = [controller getPageActionInfoMsgFrame]; 152 NSRect msg2Frame = [controller getExtraInfoMsgFrame];
153 // Pageaction message should be kInnerVerticalMargin pixels above bottom msg. 153 // Pageaction message should be kInnerVerticalMargin pixels above bottom msg.
154 EXPECT_EQ(msg2Frame.origin.y, 154 EXPECT_EQ(msg2Frame.origin.y,
155 msg3Frame.origin.y + msg3Frame.size.height + 155 msg3Frame.origin.y + msg3Frame.size.height +
156 extension_installed_bubble::kInnerVerticalMargin); 156 extension_installed_bubble::kInnerVerticalMargin);
157 NSRect msg1Frame = [controller getExtensionInstalledMsgFrame]; 157 NSRect msg1Frame = [controller getExtensionInstalledMsgFrame];
158 // Top message should be kInnerVerticalMargin pixels above Pageaction msg. 158 // Top message should be kInnerVerticalMargin pixels above Pageaction msg.
159 EXPECT_EQ(msg1Frame.origin.y, 159 EXPECT_EQ(msg1Frame.origin.y,
160 msg2Frame.origin.y + msg2Frame.size.height + 160 msg2Frame.origin.y + msg2Frame.size.height +
161 extension_installed_bubble::kInnerVerticalMargin); 161 extension_installed_bubble::kInnerVerticalMargin);
162 162
(...skipping 30 matching lines...) Expand all
193 extension_installed_bubble::kOuterVerticalMargin); 193 extension_installed_bubble::kOuterVerticalMargin);
194 NSRect msg1Frame = [controller getExtensionInstalledMsgFrame]; 194 NSRect msg1Frame = [controller getExtensionInstalledMsgFrame];
195 // Top message should start kInnerVerticalMargin pixels above top of 195 // Top message should start kInnerVerticalMargin pixels above top of
196 // extensionInstalled message, because page action message is hidden. 196 // extensionInstalled message, because page action message is hidden.
197 EXPECT_EQ(msg1Frame.origin.y, 197 EXPECT_EQ(msg1Frame.origin.y,
198 msg3Frame.origin.y + msg3Frame.size.height + 198 msg3Frame.origin.y + msg3Frame.size.height +
199 extension_installed_bubble::kInnerVerticalMargin); 199 extension_installed_bubble::kInnerVerticalMargin);
200 200
201 [controller close]; 201 [controller close];
202 } 202 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/extension_installed_bubble_controller.mm ('k') | chrome/browser/extensions/extension_install_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698