| 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 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ui/base/material_design/material_design_controller.h" | 22 #include "ui/base/material_design/material_design_controller.h" |
| 23 #include "ui/base/test/material_design_controller_test_api.h" | 23 #include "ui/base/test/material_design_controller_test_api.h" |
| 24 #include "ui/events/test/cocoa_test_event_utils.h" | 24 #include "ui/events/test/cocoa_test_event_utils.h" |
| 25 #import "ui/gfx/mac/coordinate_conversion.h" | 25 #import "ui/gfx/mac/coordinate_conversion.h" |
| 26 #import "ui/gfx/test/ui_cocoa_test_helper.h" | 26 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 27 #import "ui/views/cocoa/bridged_content_view.h" | 27 #import "ui/views/cocoa/bridged_content_view.h" |
| 28 #import "ui/views/cocoa/native_widget_mac_nswindow.h" | 28 #import "ui/views/cocoa/native_widget_mac_nswindow.h" |
| 29 #import "ui/views/cocoa/views_nswindow_delegate.h" | 29 #import "ui/views/cocoa/views_nswindow_delegate.h" |
| 30 #include "ui/views/controls/textfield/textfield.h" | 30 #include "ui/views/controls/textfield/textfield.h" |
| 31 #include "ui/views/controls/textfield/textfield_model.h" | 31 #include "ui/views/controls/textfield/textfield_model.h" |
| 32 #include "ui/views/test/test_views_delegate.h" |
| 32 #include "ui/views/view.h" | 33 #include "ui/views/view.h" |
| 33 #include "ui/views/widget/native_widget_mac.h" | 34 #include "ui/views/widget/native_widget_mac.h" |
| 34 #include "ui/views/widget/root_view.h" | 35 #include "ui/views/widget/root_view.h" |
| 35 #include "ui/views/widget/widget.h" | 36 #include "ui/views/widget/widget.h" |
| 36 #include "ui/views/widget/widget_observer.h" | 37 #include "ui/views/widget/widget_observer.h" |
| 37 | 38 |
| 38 using base::ASCIIToUTF16; | 39 using base::ASCIIToUTF16; |
| 39 using base::SysNSStringToUTF8; | 40 using base::SysNSStringToUTF8; |
| 40 using base::SysNSStringToUTF16; | 41 using base::SysNSStringToUTF16; |
| 41 using base::SysUTF8ToNSString; | 42 using base::SysUTF8ToNSString; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 281 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 281 ui::CocoaTest::TearDown(); | 282 ui::CocoaTest::TearDown(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 protected: | 285 protected: |
| 285 std::unique_ptr<Widget> widget_; | 286 std::unique_ptr<Widget> widget_; |
| 286 MockNativeWidgetMac* native_widget_mac_; // Weak. Owned by |widget_|. | 287 MockNativeWidgetMac* native_widget_mac_; // Weak. Owned by |widget_|. |
| 287 | 288 |
| 288 // Make the InitParams available to tests to cover initialization codepaths. | 289 // Make the InitParams available to tests to cover initialization codepaths. |
| 289 Widget::InitParams init_params_; | 290 Widget::InitParams init_params_; |
| 291 |
| 292 private: |
| 293 TestViewsDelegate test_views_delegate_; |
| 294 |
| 295 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestBase); |
| 290 }; | 296 }; |
| 291 | 297 |
| 292 class BridgedNativeWidgetTest : public BridgedNativeWidgetTestBase { | 298 class BridgedNativeWidgetTest : public BridgedNativeWidgetTestBase { |
| 293 public: | 299 public: |
| 294 BridgedNativeWidgetTest(); | 300 BridgedNativeWidgetTest(); |
| 295 ~BridgedNativeWidgetTest() override; | 301 ~BridgedNativeWidgetTest() override; |
| 296 | 302 |
| 297 // Install a textfield with input type |text_input_type| in the view hierarchy | 303 // Install a textfield with input type |text_input_type| in the view hierarchy |
| 298 // and make it the text input client. Also initializes |dummy_text_view_|. | 304 // and make it the text input client. Also initializes |dummy_text_view_|. |
| 299 void InstallTextField(const base::string16& text, | 305 void InstallTextField(const base::string16& text, |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 [center postNotificationName:NSWindowDidExitFullScreenNotification | 1330 [center postNotificationName:NSWindowDidExitFullScreenNotification |
| 1325 object:window]; | 1331 object:window]; |
| 1326 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. | 1332 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. |
| 1327 EXPECT_FALSE(bridge()->target_fullscreen_state()); | 1333 EXPECT_FALSE(bridge()->target_fullscreen_state()); |
| 1328 | 1334 |
| 1329 widget_->CloseNow(); | 1335 widget_->CloseNow(); |
| 1330 } | 1336 } |
| 1331 | 1337 |
| 1332 } // namespace test | 1338 } // namespace test |
| 1333 } // namespace views | 1339 } // namespace views |
| OLD | NEW |