| 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/mac_util.h" | 9 #import "base/mac/mac_util.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // ContextFactory. | 63 // ContextFactory. |
| 64 widget_.reset(); | 64 widget_.reset(); |
| 65 WidgetTest::TearDown(); | 65 WidgetTest::TearDown(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 NSWindow* test_window() { | 68 NSWindow* test_window() { |
| 69 return widget_->GetNativeWindow(); | 69 return widget_->GetNativeWindow(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 scoped_ptr<Widget> widget_; | 73 std::unique_ptr<Widget> widget_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // Tests for correct fullscreen tracking, regardless of whether it is initiated | 76 // Tests for correct fullscreen tracking, regardless of whether it is initiated |
| 77 // by the Widget code or elsewhere (e.g. by the user). | 77 // by the Widget code or elsewhere (e.g. by the user). |
| 78 TEST_F(BridgedNativeWidgetUITest, FullscreenSynchronousState) { | 78 TEST_F(BridgedNativeWidgetUITest, FullscreenSynchronousState) { |
| 79 EXPECT_FALSE(widget_->IsFullscreen()); | 79 EXPECT_FALSE(widget_->IsFullscreen()); |
| 80 | 80 |
| 81 // Allow user-initiated fullscreen changes on the Window. | 81 // Allow user-initiated fullscreen changes on the Window. |
| 82 [test_window() | 82 [test_window() |
| 83 setCollectionBehavior:[test_window() collectionBehavior] | | 83 setCollectionBehavior:[test_window() collectionBehavior] | |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 NSEvent* mouse_up = cocoa_test_event_utils::MouseEventAtPointInWindow( | 476 NSEvent* mouse_up = cocoa_test_event_utils::MouseEventAtPointInWindow( |
| 477 NSMakePoint(30, 30), NSLeftMouseUp, window, 0); | 477 NSMakePoint(30, 30), NSLeftMouseUp, window, 0); |
| 478 CGEventPost(kCGSessionEventTap, [mouse_up CGEvent]); | 478 CGEventPost(kCGSessionEventTap, [mouse_up CGEvent]); |
| 479 WaitForEvent(NSLeftMouseUpMask); | 479 WaitForEvent(NSLeftMouseUpMask); |
| 480 EXPECT_EQ(120, [window frame].origin.x); | 480 EXPECT_EQ(120, [window frame].origin.x); |
| 481 } | 481 } |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace test | 484 } // namespace test |
| 485 } // namespace views | 485 } // namespace views |
| OLD | NEW |