| OLD | NEW |
| 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" |
| 11 #import "chrome/browser/ui/cocoa/bubble_view.h" | 11 #import "chrome/browser/ui/cocoa/bubble_view.h" |
| 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 13 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" | 13 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #import "testing/gtest_mac.h" | 15 #import "testing/gtest_mac.h" |
| 16 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
| 17 #include "ui/gfx/point.h" | 17 #include "ui/gfx/point.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 using base::UTF8ToUTF16; |
| 21 |
| 20 // The test delegate records all of the status bubble object's state | 22 // The test delegate records all of the status bubble object's state |
| 21 // transitions. | 23 // transitions. |
| 22 @interface StatusBubbleMacTestDelegate : NSObject { | 24 @interface StatusBubbleMacTestDelegate : NSObject { |
| 23 @private | 25 @private |
| 24 NSWindow* window_; // Weak. | 26 NSWindow* window_; // Weak. |
| 25 NSPoint baseFrameOffset_; | 27 NSPoint baseFrameOffset_; |
| 26 std::vector<StatusBubbleMac::StatusBubbleState> states_; | 28 std::vector<StatusBubbleMac::StatusBubbleState> states_; |
| 27 } | 29 } |
| 28 - (id)initWithWindow:(NSWindow*)window; | 30 - (id)initWithWindow:(NSWindow*)window; |
| 29 - (void)forceBaseFrameOffset:(NSPoint)baseFrameOffset; | 31 - (void)forceBaseFrameOffset:(NSPoint)baseFrameOffset; |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 int windowWidth = NSWidth([window frame]); | 656 int windowWidth = NSWidth([window frame]); |
| 655 for (int x = 0; x < windowWidth; x += smallValue) { | 657 for (int x = 0; x < windowWidth; x += smallValue) { |
| 656 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); | 658 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); |
| 657 } | 659 } |
| 658 | 660 |
| 659 // Simulate moving the mouse from right to left. | 661 // Simulate moving the mouse from right to left. |
| 660 for (int x = windowWidth; x >= 0; x -= smallValue) { | 662 for (int x = windowWidth; x >= 0; x -= smallValue) { |
| 661 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); | 663 ASSERT_TRUE(CheckAvoidsMouse(x, smallValue)); |
| 662 } | 664 } |
| 663 } | 665 } |
| OLD | NEW |