OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_win.h" | 5 #include "views/widget/native_widget_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 private: | 39 private: |
40 MessageLoopForUI message_loop_; | 40 MessageLoopForUI message_loop_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest); | 42 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest); |
43 }; | 43 }; |
44 | 44 |
45 NativeWidgetWin* NativeWidgetWinTest::CreateNativeWidgetWin() { | 45 NativeWidgetWin* NativeWidgetWinTest::CreateNativeWidgetWin() { |
46 scoped_ptr<Widget> widget(new Widget); | 46 scoped_ptr<Widget> widget(new Widget); |
47 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); | 47 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); |
48 params.delete_on_destroy = false; | 48 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
49 params.bounds = gfx::Rect(50, 50, 650, 650); | 49 params.bounds = gfx::Rect(50, 50, 650, 650); |
50 widget->Init(params); | 50 widget->Init(params); |
51 return static_cast<NativeWidgetWin*>(widget.release()->native_widget()); | 51 return static_cast<NativeWidgetWin*>(widget.release()->native_widget()); |
52 } | 52 } |
53 | 53 |
54 TEST_F(NativeWidgetWinTest, ZoomWindow) { | 54 TEST_F(NativeWidgetWinTest, ZoomWindow) { |
55 scoped_ptr<NativeWidgetWin> window(CreateNativeWidgetWin()); | 55 scoped_ptr<NativeWidgetWin> window(CreateNativeWidgetWin()); |
56 window->ShowWindow(SW_HIDE); | 56 window->ShowWindow(SW_HIDE); |
57 EXPECT_FALSE(window->IsActive()); | 57 EXPECT_FALSE(window->IsActive()); |
58 window->ShowWindow(SW_MAXIMIZE); | 58 window->ShowWindow(SW_MAXIMIZE); |
(...skipping 18 matching lines...) Expand all Loading... |
77 EXPECT_FALSE(window->IsZoomed()); | 77 EXPECT_FALSE(window->IsZoomed()); |
78 EXPECT_FALSE(window->IsActive()); | 78 EXPECT_FALSE(window->IsActive()); |
79 | 79 |
80 // Cleanup. | 80 // Cleanup. |
81 window->CloseNow(); | 81 window->CloseNow(); |
82 window2->CloseNow(); | 82 window2->CloseNow(); |
83 } | 83 } |
84 | 84 |
85 } // namespace | 85 } // namespace |
86 } // namespace views | 86 } // namespace views |
OLD | NEW |