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

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

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/widget/native_widget_win_unittest.cc » ('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.h" 10 #include "base/message_loop.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 virtual void TearDown() OVERRIDE { 47 virtual void TearDown() OVERRIDE {
48 message_loop_.RunUntilIdle(); 48 message_loop_.RunUntilIdle();
49 aura_test_helper_->TearDown(); 49 aura_test_helper_->TearDown();
50 } 50 }
51 51
52 protected: 52 protected:
53 aura::RootWindow* root_window() { return aura_test_helper_->root_window(); } 53 aura::RootWindow* root_window() { return aura_test_helper_->root_window(); }
54 54
55 private: 55 private:
56 MessageLoopForUI message_loop_; 56 base::MessageLoopForUI message_loop_;
57 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; 57 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_;
58 58
59 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); 59 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest);
60 }; 60 };
61 61
62 TEST_F(NativeWidgetAuraTest, CenterWindowLargeParent) { 62 TEST_F(NativeWidgetAuraTest, CenterWindowLargeParent) {
63 // Make a parent window larger than the host represented by rootwindow. 63 // Make a parent window larger than the host represented by rootwindow.
64 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); 64 scoped_ptr<aura::Window> parent(new aura::Window(NULL));
65 parent->Init(ui::LAYER_NOT_DRAWN); 65 parent->Init(ui::LAYER_NOT_DRAWN);
66 parent->SetBounds(gfx::Rect(0, 0, 1024, 800)); 66 parent->SetBounds(gfx::Rect(0, 0, 1024, 800));
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 TEST_F(NativeWidgetAuraTest, NoCrashOnThemeAfterClose) { 399 TEST_F(NativeWidgetAuraTest, NoCrashOnThemeAfterClose) {
400 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); 400 scoped_ptr<aura::Window> parent(new aura::Window(NULL));
401 parent->Init(ui::LAYER_NOT_DRAWN); 401 parent->Init(ui::LAYER_NOT_DRAWN);
402 parent->SetBounds(gfx::Rect(0, 0, 480, 320)); 402 parent->SetBounds(gfx::Rect(0, 0, 480, 320));
403 scoped_ptr<Widget> widget(new Widget()); 403 scoped_ptr<Widget> widget(new Widget());
404 NativeWidgetAura* window = Init(parent.get(), widget.get()); 404 NativeWidgetAura* window = Init(parent.get(), widget.get());
405 window->Show(); 405 window->Show();
406 window->Close(); 406 window->Close();
407 MessageLoop::current()->RunUntilIdle(); 407 base::MessageLoop::current()->RunUntilIdle();
408 widget->GetNativeTheme(); // Shouldn't crash. 408 widget->GetNativeTheme(); // Shouldn't crash.
409 } 409 }
410 410
411 } // namespace 411 } // namespace
412 } // namespace views 412 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/widget/native_widget_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698