Commit cc4cd11d authored by erikchen's avatar erikchen Committed by Commit bot

mac: Fix StatusBubbleMacTest on OSX 10.10.

The test relied on implicit assumptions about the system font. The system font
changed in OSX 10.10. I changed the test to always use a fixed font.

BUG=390276

Review URL: https://codereview.chromium.org/595053002

Cr-Commit-Position: refs/heads/master@{#296616}
parent a88fa855
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h" #import "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
#include "ui/gfx/point.h" #include "ui/gfx/point.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -579,6 +580,14 @@ TEST_F(StatusBubbleMacTest, StatuBubbleRespectsBaseFrameLimits) { ...@@ -579,6 +580,14 @@ TEST_F(StatusBubbleMacTest, StatuBubbleRespectsBaseFrameLimits) {
TEST_F(StatusBubbleMacTest, ExpandBubble) { TEST_F(StatusBubbleMacTest, ExpandBubble) {
NSWindow* window = test_window(); NSWindow* window = test_window();
// The system font changes between OSX 10.9 and OSX 10.10. Use the system
// font from OSX 10.9 for this test.
id mockContentView =
[OCMockObject partialMockForObject:[GetWindow() contentView]];
[[[mockContentView stub]
andReturn:[NSFont fontWithName:@"Lucida Grande" size:11]] font];
ASSERT_TRUE(window); ASSERT_TRUE(window);
NSRect window_frame = [window frame]; NSRect window_frame = [window frame];
window_frame.size.width = 600.0; window_frame.size.width = 600.0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment