| 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 #include "ui/views/widget/native_widget_mac.h" | 5 #include "ui/views/widget/native_widget_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "ui/views/test/widget_test.h" | 9 #include "ui/views/test/widget_test.h" |
| 10 #include "ui/views/test/test_widget_observer.h" | 10 #include "ui/views/test/test_widget_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Observer; | 21 class Observer; |
| 22 | 22 |
| 23 NativeWidgetMacInteractiveUITest() | 23 NativeWidgetMacInteractiveUITest() |
| 24 : activationCount_(0), deactivationCount_(0) {} | 24 : activationCount_(0), deactivationCount_(0) {} |
| 25 | 25 |
| 26 Widget* MakeWidget() { | 26 Widget* MakeWidget() { |
| 27 return GetParam() ? CreateTopLevelFramelessPlatformWidget() | 27 return GetParam() ? CreateTopLevelFramelessPlatformWidget() |
| 28 : CreateTopLevelPlatformWidget(); | 28 : CreateTopLevelPlatformWidget(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 // Overridden form testing::Test: | |
| 32 virtual void SetUp() { | |
| 33 // Unbundled applications (those without Info.plist) default to | |
| 34 // NSApplicationActivationPolicyProhibited, which prohibits the application | |
| 35 // obtaining key status. | |
| 36 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; | |
| 37 WidgetTest::SetUp(); | |
| 38 } | |
| 39 | |
| 40 protected: | 31 protected: |
| 41 scoped_ptr<Observer> observer_; | 32 scoped_ptr<Observer> observer_; |
| 42 int activationCount_; | 33 int activationCount_; |
| 43 int deactivationCount_; | 34 int deactivationCount_; |
| 44 | 35 |
| 45 private: | 36 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMacInteractiveUITest); | 37 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMacInteractiveUITest); |
| 47 }; | 38 }; |
| 48 | 39 |
| 49 class NativeWidgetMacInteractiveUITest::Observer : public TestWidgetObserver { | 40 class NativeWidgetMacInteractiveUITest::Observer : public TestWidgetObserver { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 widget2->CloseNow(); | 128 widget2->CloseNow(); |
| 138 widget->CloseNow(); | 129 widget->CloseNow(); |
| 139 } | 130 } |
| 140 | 131 |
| 141 INSTANTIATE_TEST_CASE_P(NativeWidgetMacInteractiveUITestInstance, | 132 INSTANTIATE_TEST_CASE_P(NativeWidgetMacInteractiveUITestInstance, |
| 142 NativeWidgetMacInteractiveUITest, | 133 NativeWidgetMacInteractiveUITest, |
| 143 ::testing::Bool()); | 134 ::testing::Bool()); |
| 144 | 135 |
| 145 } // namespace test | 136 } // namespace test |
| 146 } // namespace views | 137 } // namespace views |
| OLD | NEW |