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

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

Issue 2738623002: [Mac] Turn on Auto Layout for browser windows. (Closed)
Patch Set: Trigger Auto Layout from chromeContentView, which covers all browser windows. Created 3 years, 9 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
Index: chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
index 64404c0f008fe295a3ecc2d1552ad63444629f5e..f5792d41856bbc160381dc5871cfead8271025fd 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
@@ -747,6 +747,16 @@ TEST_F(BrowserWindowControllerTest, TabStripBackgroundViewRedrawTest) {
[partial_mock verify];
}
+// Test that the window uses Auto Layout. Since frame-based layout and Auto
+// Layout behave differently in subtle ways, we shouldn't start/stop using it
+// accidentally. If we don't want Auto Layout, this test should be changed to
+// expect that chromeContentView has no constraints.
+TEST_F(BrowserWindowControllerTest, UsesAutoLayout) {
+ // If Auto Layout is on, there will at least be synthesized constraints based
tapted 2017/03/22 22:40:00 nit: remove `at least`? (or "..there will be at l
Sidney San Martín 2017/03/22 23:29:59 Done.
+ // on the view's frame and autoresizing mask.
+ EXPECT_NE(0u, [[[controller_ chromeContentView] constraints] count]);
+}
+
@interface BrowserWindowControllerFakeFullscreen : BrowserWindowController {
@private
// We release the window ourselves, so we don't have to rely on the unittest

Powered by Google App Engine
This is Rietveld 408576698