| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 TEST_F(ToolbarControllerTest, BookmarkBubblePoint) { | 338 TEST_F(ToolbarControllerTest, BookmarkBubblePoint) { |
| 339 const NSPoint starPoint = [bar_ bookmarkBubblePoint]; | 339 const NSPoint starPoint = [bar_ bookmarkBubblePoint]; |
| 340 const NSRect barFrame = | 340 const NSRect barFrame = |
| 341 [[bar_ view] convertRect:[[bar_ view] bounds] toView:nil]; | 341 [[bar_ view] convertRect:[[bar_ view] bounds] toView:nil]; |
| 342 | 342 |
| 343 // Make sure the star is completely inside the location bar. | 343 // Make sure the star is completely inside the location bar. |
| 344 EXPECT_TRUE(NSPointInRect(starPoint, barFrame)); | 344 EXPECT_TRUE(NSPointInRect(starPoint, barFrame)); |
| 345 } | 345 } |
| 346 | 346 |
| 347 TEST_F(ToolbarControllerTest, TranslateBubblePoint) { | 347 TEST_F(ToolbarControllerTest, TranslateBubblePoint) { |
| 348 const NSPoint translatePoint = [bar_ translateBubblePoint]; | 348 const NSPoint translatePoint = |
| 349 [bar_ bubblePointForDecoration:[bar_ translateDecoration]]; |
| 349 const NSRect barFrame = | 350 const NSRect barFrame = |
| 350 [[bar_ view] convertRect:[[bar_ view] bounds] toView:nil]; | 351 [[bar_ view] convertRect:[[bar_ view] bounds] toView:nil]; |
| 351 EXPECT_TRUE(NSPointInRect(translatePoint, barFrame)); | 352 EXPECT_TRUE(NSPointInRect(translatePoint, barFrame)); |
| 352 } | 353 } |
| 353 | 354 |
| 354 TEST_F(ToolbarControllerTest, HoverButtonForEvent) { | 355 TEST_F(ToolbarControllerTest, HoverButtonForEvent) { |
| 355 base::scoped_nsobject<HitView> view( | 356 base::scoped_nsobject<HitView> view( |
| 356 [[HitView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); | 357 [[HitView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); |
| 357 NSView* toolbarView = [bar_ view]; | 358 NSView* toolbarView = [bar_ view]; |
| 358 [bar_ setView:view]; | 359 [bar_ setView:view]; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 void WaitUntilBrowserRemoved() { run_loop_.Run(); } | 394 void WaitUntilBrowserRemoved() { run_loop_.Run(); } |
| 394 void OnBrowserRemoved(Browser* browser) override { run_loop_.Quit(); } | 395 void OnBrowserRemoved(Browser* browser) override { run_loop_.Quit(); } |
| 395 | 396 |
| 396 private: | 397 private: |
| 397 base::RunLoop run_loop_; | 398 base::RunLoop run_loop_; |
| 398 | 399 |
| 399 DISALLOW_COPY_AND_ASSIGN(BrowserRemovedObserver); | 400 DISALLOW_COPY_AND_ASSIGN(BrowserRemovedObserver); |
| 400 }; | 401 }; |
| 401 | 402 |
| 402 } // namespace | 403 } // namespace |
| OLD | NEW |