| 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 "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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 188 } |
| 189 | 189 |
| 190 // This class provides functionality to verify that the BubbleView shows up | 190 // This class provides functionality to verify that the BubbleView shows up |
| 191 // when we call BubbleDelegateView::StartFade(true) and is destroyed when we | 191 // when we call BubbleDelegateView::StartFade(true) and is destroyed when we |
| 192 // call BubbleDelegateView::StartFade(false). | 192 // call BubbleDelegateView::StartFade(false). |
| 193 class BubbleWidgetClosingTest : public BubbleDelegateTest, | 193 class BubbleWidgetClosingTest : public BubbleDelegateTest, |
| 194 public views::WidgetObserver { | 194 public views::WidgetObserver { |
| 195 public: | 195 public: |
| 196 BubbleWidgetClosingTest() : bubble_destroyed_(false) { | 196 BubbleWidgetClosingTest() : bubble_destroyed_(false) { |
| 197 #if defined(USE_AURA) | 197 #if defined(USE_AURA) |
| 198 aura::Env::CreateInstance(); |
| 198 loop_.set_dispatcher(aura::Env::GetInstance()->GetDispatcher()); | 199 loop_.set_dispatcher(aura::Env::GetInstance()->GetDispatcher()); |
| 199 #endif | 200 #endif |
| 200 } | 201 } |
| 201 | 202 |
| 202 virtual ~BubbleWidgetClosingTest() {} | 203 virtual ~BubbleWidgetClosingTest() {} |
| 203 | 204 |
| 204 void Observe(views::Widget* widget) { | 205 void Observe(views::Widget* widget) { |
| 205 widget->AddObserver(this); | 206 widget->AddObserver(this); |
| 206 } | 207 } |
| 207 | 208 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 bubble_widget->GetFocusManager()->GetFocusedView()); | 240 bubble_widget->GetFocusManager()->GetFocusedView()); |
| 240 | 241 |
| 241 Observe(bubble_widget); | 242 Observe(bubble_widget); |
| 242 | 243 |
| 243 bubble_delegate->StartFade(false); | 244 bubble_delegate->StartFade(false); |
| 244 RunNestedLoop(); | 245 RunNestedLoop(); |
| 245 EXPECT_TRUE(bubble_destroyed()); | 246 EXPECT_TRUE(bubble_destroyed()); |
| 246 } | 247 } |
| 247 | 248 |
| 248 } // namespace views | 249 } // namespace views |
| OLD | NEW |