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

Unified Diff: chrome/browser/ui/cocoa/fast_resize_view_unittest.mm

Issue 469003006: Remove --disable-core-animation flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erikchen_patch
Patch Set: Rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/fast_resize_view.mm ('k') | chrome/browser/ui/cocoa/find_bar/find_bar_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/fast_resize_view_unittest.mm
diff --git a/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm b/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm
deleted file mode 100644
index edfea60aa0b07fdc2e673384b76ccb607f3278c4..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/mac/scoped_nsobject.h"
-#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
-#import "chrome/browser/ui/cocoa/fast_resize_view.h"
-
-namespace {
-
-class FastResizeViewTest : public CocoaTest {
- public:
- FastResizeViewTest() {
- NSRect frame = NSMakeRect(0, 0, 100, 30);
- base::scoped_nsobject<FastResizeView> view(
- [[FastResizeView alloc] initWithFrame:frame]);
- view_ = view.get();
- [[test_window() contentView] addSubview:view_];
-
- base::scoped_nsobject<NSView> childView(
- [[NSView alloc] initWithFrame:frame]);
- childView_ = childView.get();
- [view_ addSubview:childView_];
- }
-
- FastResizeView* view_;
- NSView* childView_;
-};
-
-TEST_VIEW(FastResizeViewTest, view_);
-
-TEST_F(FastResizeViewTest, TestResizingOfChildren) {
- NSRect squareFrame = NSMakeRect(0, 0, 200, 200);
- NSRect rectFrame = NSMakeRect(1, 1, 150, 300);
-
- // Test that changing the view's frame also changes the child's frame.
- [view_ setFrame:squareFrame];
- EXPECT_TRUE(NSEqualRects([view_ bounds], [childView_ frame]));
-
- // Turn fast resize mode on and change the view's frame. This time, the child
- // should not resize, but it should be anchored to the top left.
- [view_ setFastResizeMode:YES];
- [view_ setFrame:NSMakeRect(15, 30, 250, 250)];
- EXPECT_TRUE(NSEqualSizes([childView_ frame].size, squareFrame.size));
- EXPECT_EQ(NSMinX([view_ bounds]), NSMinX([childView_ frame]));
- EXPECT_EQ(NSMaxY([view_ bounds]), NSMaxY([childView_ frame]));
-
- // Another resize with fast resize mode on.
- [view_ setFrame:rectFrame];
- EXPECT_TRUE(NSEqualSizes([childView_ frame].size, squareFrame.size));
- EXPECT_EQ(NSMinX([view_ bounds]), NSMinX([childView_ frame]));
- EXPECT_EQ(NSMaxY([view_ bounds]), NSMaxY([childView_ frame]));
-
- // Turn fast resize mode off. This should initiate an immediate resize, even
- // though we haven't called setFrame directly.
- [view_ setFastResizeMode:NO];
- EXPECT_TRUE(NSEqualRects([view_ frame], rectFrame));
- EXPECT_TRUE(NSEqualRects([view_ bounds], [childView_ frame]));
-}
-
-} // namespace
« no previous file with comments | « chrome/browser/ui/cocoa/fast_resize_view.mm ('k') | chrome/browser/ui/cocoa/find_bar/find_bar_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698