Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: trunk/src/ui/views/widget/native_widget_aura_unittest.cc

Issue 291013003: Revert 271468 "Revert of [Refactor] Consolidate the logic for wh..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/ui/views/widget/native_widget_aura.cc ('k') | trunk/src/ui/views/widget/widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « trunk/src/ui/views/widget/native_widget_aura.cc ('k') | trunk/src/ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698