OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |