OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "ui/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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Create a simple widget win. The caller is responsible for taking ownership | 27 // Create a simple widget win. The caller is responsible for taking ownership |
28 // of the returned value. | 28 // of the returned value. |
29 NativeWidgetWin* CreateNativeWidgetWin(); | 29 NativeWidgetWin* CreateNativeWidgetWin(); |
30 | 30 |
31 void RunPendingMessages() { | 31 void RunPendingMessages() { |
32 message_loop_.RunUntilIdle(); | 32 message_loop_.RunUntilIdle(); |
33 } | 33 } |
34 | 34 |
35 private: | 35 private: |
36 MessageLoopForUI message_loop_; | 36 base::MessageLoopForUI message_loop_; |
37 ui::ScopedOleInitializer ole_initializer_; | 37 ui::ScopedOleInitializer ole_initializer_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest); | 39 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest); |
40 }; | 40 }; |
41 | 41 |
42 NativeWidgetWin* NativeWidgetWinTest::CreateNativeWidgetWin() { | 42 NativeWidgetWin* NativeWidgetWinTest::CreateNativeWidgetWin() { |
43 scoped_ptr<Widget> widget(new Widget); | 43 scoped_ptr<Widget> widget(new Widget); |
44 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 44 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); |
45 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 45 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
46 params.bounds = gfx::Rect(50, 50, 650, 650); | 46 params.bounds = gfx::Rect(50, 50, 650, 650); |
(...skipping 27 matching lines...) Expand all Loading... |
74 EXPECT_FALSE(IsZoomed(window->GetNativeView())); | 74 EXPECT_FALSE(IsZoomed(window->GetNativeView())); |
75 EXPECT_FALSE(window->IsActive()); | 75 EXPECT_FALSE(window->IsActive()); |
76 | 76 |
77 // Cleanup. | 77 // Cleanup. |
78 window->CloseNow(); | 78 window->CloseNow(); |
79 window2->CloseNow(); | 79 window2->CloseNow(); |
80 } | 80 } |
81 | 81 |
82 } // namespace | 82 } // namespace |
83 } // namespace views | 83 } // namespace views |
OLD | NEW |