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_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 class NativeWidgetAuraTest : public ViewsTestBase { | 35 class NativeWidgetAuraTest : public ViewsTestBase { |
36 public: | 36 public: |
37 NativeWidgetAuraTest() {} | 37 NativeWidgetAuraTest() {} |
38 virtual ~NativeWidgetAuraTest() {} | 38 virtual ~NativeWidgetAuraTest() {} |
39 | 39 |
40 // testing::Test overrides: | 40 // testing::Test overrides: |
41 virtual void SetUp() OVERRIDE { | 41 virtual void SetUp() OVERRIDE { |
42 ViewsTestBase::SetUp(); | 42 ViewsTestBase::SetUp(); |
43 root_window()->SetBounds(gfx::Rect(0, 0, 640, 480)); | 43 dispatcher()->host()->SetBounds(gfx::Rect(640, 480)); |
44 dispatcher()->SetHostSize(gfx::Size(640, 480)); | |
45 } | 44 } |
46 | 45 |
47 protected: | 46 protected: |
48 aura::Window* root_window() { return GetContext(); } | 47 aura::Window* root_window() { return GetContext(); } |
49 aura::RootWindow* dispatcher() { return root_window()->GetDispatcher(); } | 48 aura::RootWindow* dispatcher() { return root_window()->GetDispatcher(); } |
50 | 49 |
51 private: | 50 private: |
52 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); | 51 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); |
53 }; | 52 }; |
54 | 53 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 scoped_ptr<Widget> widget(new Widget()); | 395 scoped_ptr<Widget> widget(new Widget()); |
397 NativeWidgetAura* window = Init(parent.get(), widget.get()); | 396 NativeWidgetAura* window = Init(parent.get(), widget.get()); |
398 window->Show(); | 397 window->Show(); |
399 window->Close(); | 398 window->Close(); |
400 base::MessageLoop::current()->RunUntilIdle(); | 399 base::MessageLoop::current()->RunUntilIdle(); |
401 widget->GetNativeTheme(); // Shouldn't crash. | 400 widget->GetNativeTheme(); // Shouldn't crash. |
402 } | 401 } |
403 | 402 |
404 } // namespace | 403 } // namespace |
405 } // namespace views | 404 } // namespace views |
OLD | NEW |