| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 EXPECT_TRUE(window->GetProperty(aura::client::kDrawAttentionKey)); | 425 EXPECT_TRUE(window->GetProperty(aura::client::kDrawAttentionKey)); |
| 426 widget->Activate(); | 426 widget->Activate(); |
| 427 EXPECT_FALSE(window->GetProperty(aura::client::kDrawAttentionKey)); | 427 EXPECT_FALSE(window->GetProperty(aura::client::kDrawAttentionKey)); |
| 428 } | 428 } |
| 429 | 429 |
| 430 TEST_F(NativeWidgetAuraTest, NoCrashOnThemeAfterClose) { | 430 TEST_F(NativeWidgetAuraTest, NoCrashOnThemeAfterClose) { |
| 431 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); | 431 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); |
| 432 parent->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 432 parent->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 433 parent->SetBounds(gfx::Rect(0, 0, 480, 320)); | 433 parent->SetBounds(gfx::Rect(0, 0, 480, 320)); |
| 434 scoped_ptr<Widget> widget(new Widget()); | 434 scoped_ptr<Widget> widget(new Widget()); |
| 435 NativeWidgetAura* window = Init(parent.get(), widget.get()); | 435 Init(parent.get(), widget.get()); |
| 436 window->Show(); | 436 widget->Show(); |
| 437 window->Close(); | 437 widget->Close(); |
| 438 base::MessageLoop::current()->RunUntilIdle(); | 438 base::MessageLoop::current()->RunUntilIdle(); |
| 439 widget->GetNativeTheme(); // Shouldn't crash. | 439 widget->GetNativeTheme(); // Shouldn't crash. |
| 440 } | 440 } |
| 441 | 441 |
| 442 // Used to track calls to WidgetDelegate::OnWidgetMove(). | 442 // Used to track calls to WidgetDelegate::OnWidgetMove(). |
| 443 class MoveTestWidgetDelegate : public WidgetDelegateView { | 443 class MoveTestWidgetDelegate : public WidgetDelegateView { |
| 444 public: | 444 public: |
| 445 MoveTestWidgetDelegate() : got_move_(false) {} | 445 MoveTestWidgetDelegate() : got_move_(false) {} |
| 446 virtual ~MoveTestWidgetDelegate() {} | 446 virtual ~MoveTestWidgetDelegate() {} |
| 447 | 447 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 472 delegate->ClearGotMove(); | 472 delegate->ClearGotMove(); |
| 473 // Simulate a maximize with animation. | 473 // Simulate a maximize with animation. |
| 474 delete widget->GetNativeView()->RecreateLayer().release(); | 474 delete widget->GetNativeView()->RecreateLayer().release(); |
| 475 widget->SetBounds(gfx::Rect(0, 0, 500, 500)); | 475 widget->SetBounds(gfx::Rect(0, 0, 500, 500)); |
| 476 EXPECT_TRUE(delegate->got_move()); | 476 EXPECT_TRUE(delegate->got_move()); |
| 477 widget->CloseNow(); | 477 widget->CloseNow(); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace | 480 } // namespace |
| 481 } // namespace views | 481 } // namespace views |
| OLD | NEW |