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

Side by Side Diff: ui/views/cocoa/bridged_native_widget_unittest.mm

Issue 927233003: MacViews: Fix positioning of top-level Widgets with parents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150129-MacViews-Bringup5
Patch Set: Added comment to BridgedNativeWidget Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #import "base/mac/foundation_util.h" 9 #import "base/mac/foundation_util.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 scoped_ptr<BridgedNativeWidget>& bridge() { 105 scoped_ptr<BridgedNativeWidget>& bridge() {
106 return native_widget_mac_->bridge(); 106 return native_widget_mac_->bridge();
107 } 107 }
108 108
109 // Overridden from testing::Test: 109 // Overridden from testing::Test:
110 void SetUp() override { 110 void SetUp() override {
111 ui::CocoaTest::SetUp(); 111 ui::CocoaTest::SetUp();
112 112
113 init_params_.native_widget = native_widget_mac_; 113 init_params_.native_widget = native_widget_mac_;
114 114
115 // Use a frameless window, otherwise Widget will try to center the window
116 // before the tests covering the Init() flow are ready to do that.
117 init_params_.type = Widget::InitParams::TYPE_WINDOW_FRAMELESS;
118
115 // To control the lifetime without an actual window that must be closed, 119 // To control the lifetime without an actual window that must be closed,
116 // tests in this file need to use WIDGET_OWNS_NATIVE_WIDGET. 120 // tests in this file need to use WIDGET_OWNS_NATIVE_WIDGET.
117 init_params_.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 121 init_params_.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
118 122
119 // Opacity defaults to "infer" which is usually updated by ViewsDelegate. 123 // Opacity defaults to "infer" which is usually updated by ViewsDelegate.
120 init_params_.opacity = Widget::InitParams::OPAQUE_WINDOW; 124 init_params_.opacity = Widget::InitParams::OPAQUE_WINDOW;
121 125
122 native_widget_mac_->GetWidget()->Init(init_params_); 126 native_widget_mac_->GetWidget()->Init(init_params_);
123 } 127 }
124 128
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 [center postNotificationName:NSWindowDidExitFullScreenNotification 503 [center postNotificationName:NSWindowDidExitFullScreenNotification
500 object:window]; 504 object:window];
501 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. 505 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change.
502 EXPECT_FALSE(bridge()->target_fullscreen_state()); 506 EXPECT_FALSE(bridge()->target_fullscreen_state());
503 507
504 widget_->CloseNow(); 508 widget_->CloseNow();
505 } 509 }
506 510
507 } // namespace test 511 } // namespace test
508 } // namespace views 512 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698