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

Side by Side Diff: ui/views/bubble/bubble_delegate_unittest.cc

Issue 23882007: Explicit initialization of aura::Env for browser shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased no-op Created 7 years, 2 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/aura/test/aura_test_helper.cc ('k') | no next file » | 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "ui/base/hit_test.h" 6 #include "ui/base/hit_test.h"
7 #include "ui/views/bubble/bubble_delegate.h" 7 #include "ui/views/bubble/bubble_delegate.h"
8 #include "ui/views/bubble/bubble_frame_view.h" 8 #include "ui/views/bubble/bubble_frame_view.h"
9 #include "ui/views/test/test_widget_observer.h" 9 #include "ui/views/test/test_widget_observer.h"
10 #include "ui/views/test/views_test_base.h" 10 #include "ui/views/test/views_test_base.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 248
249 // This class provides functionality to verify that the BubbleView shows up 249 // This class provides functionality to verify that the BubbleView shows up
250 // when we call BubbleDelegateView::StartFade(true) and is destroyed when we 250 // when we call BubbleDelegateView::StartFade(true) and is destroyed when we
251 // call BubbleDelegateView::StartFade(false). 251 // call BubbleDelegateView::StartFade(false).
252 class BubbleWidgetClosingTest : public BubbleDelegateTest, 252 class BubbleWidgetClosingTest : public BubbleDelegateTest,
253 public views::WidgetObserver { 253 public views::WidgetObserver {
254 public: 254 public:
255 BubbleWidgetClosingTest() : bubble_destroyed_(false) { 255 BubbleWidgetClosingTest() : bubble_destroyed_(false) {
256 #if defined(USE_AURA) 256 #if defined(USE_AURA)
257 aura::Env::CreateInstance();
257 loop_.set_dispatcher(aura::Env::GetInstance()->GetDispatcher()); 258 loop_.set_dispatcher(aura::Env::GetInstance()->GetDispatcher());
258 #endif 259 #endif
259 } 260 }
260 261
261 virtual ~BubbleWidgetClosingTest() {} 262 virtual ~BubbleWidgetClosingTest() {}
262 263
263 void Observe(views::Widget* widget) { 264 void Observe(views::Widget* widget) {
264 widget->AddObserver(this); 265 widget->AddObserver(this);
265 } 266 }
266 267
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 bubble_widget->GetFocusManager()->GetFocusedView()); 299 bubble_widget->GetFocusManager()->GetFocusedView());
299 300
300 Observe(bubble_widget); 301 Observe(bubble_widget);
301 302
302 bubble_delegate->StartFade(false); 303 bubble_delegate->StartFade(false);
303 RunNestedLoop(); 304 RunNestedLoop();
304 EXPECT_TRUE(bubble_destroyed()); 305 EXPECT_TRUE(bubble_destroyed());
305 } 306 }
306 307
307 } // namespace views 308 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698