| 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 dispatcher()->host()->SetBounds(gfx::Rect(640, 480)); | 43 root_window()->SetBounds(gfx::Rect(0, 0, 640, 480)); |
| 44 dispatcher()->SetHostSize(gfx::Size(640, 480)); |
| 44 } | 45 } |
| 45 | 46 |
| 46 protected: | 47 protected: |
| 47 aura::Window* root_window() { return GetContext(); } | 48 aura::Window* root_window() { return GetContext(); } |
| 48 aura::RootWindow* dispatcher() { return root_window()->GetDispatcher(); } | 49 aura::RootWindow* dispatcher() { return root_window()->GetDispatcher(); } |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); | 52 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); |
| 52 }; | 53 }; |
| 53 | 54 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 scoped_ptr<Widget> widget(new Widget()); | 396 scoped_ptr<Widget> widget(new Widget()); |
| 396 NativeWidgetAura* window = Init(parent.get(), widget.get()); | 397 NativeWidgetAura* window = Init(parent.get(), widget.get()); |
| 397 window->Show(); | 398 window->Show(); |
| 398 window->Close(); | 399 window->Close(); |
| 399 base::MessageLoop::current()->RunUntilIdle(); | 400 base::MessageLoop::current()->RunUntilIdle(); |
| 400 widget->GetNativeTheme(); // Shouldn't crash. | 401 widget->GetNativeTheme(); // Shouldn't crash. |
| 401 } | 402 } |
| 402 | 403 |
| 403 } // namespace | 404 } // namespace |
| 404 } // namespace views | 405 } // namespace views |
| OLD | NEW |