OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" | 5 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" |
6 | 6 |
7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
8 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" | 8 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" |
9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_event_dispatcher.h" |
12 #include "ui/views/controls/webview/webview.h" | 12 #include "ui/views/controls/webview/webview.h" |
| 13 #include "ui/wm/core/default_activation_client.h" |
13 #include "ui/wm/core/easy_resize_window_targeter.h" | 14 #include "ui/wm/core/easy_resize_window_targeter.h" |
14 | 15 |
15 class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase { | 16 class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase { |
16 public: | 17 public: |
17 ShapedAppWindowTargeterTest() | 18 ShapedAppWindowTargeterTest() |
18 : web_view_(NULL) { | 19 : web_view_(NULL) { |
19 } | 20 } |
20 | 21 |
21 virtual ~ShapedAppWindowTargeterTest() {} | 22 virtual ~ShapedAppWindowTargeterTest() {} |
22 | 23 |
23 views::Widget* widget() { return widget_.get(); } | 24 views::Widget* widget() { return widget_.get(); } |
24 | 25 |
25 apps::NativeAppWindow* app_window() { return &app_window_; } | 26 apps::NativeAppWindow* app_window() { return &app_window_; } |
26 ChromeNativeAppWindowViews* app_window_views() { return &app_window_; } | 27 ChromeNativeAppWindowViews* app_window_views() { return &app_window_; } |
27 | 28 |
28 protected: | 29 protected: |
29 virtual void SetUp() OVERRIDE { | 30 virtual void SetUp() OVERRIDE { |
30 aura::test::AuraTestBase::SetUp(); | 31 aura::test::AuraTestBase::SetUp(); |
| 32 new wm::DefaultActivationClient(root_window()); |
31 widget_.reset(new views::Widget); | 33 widget_.reset(new views::Widget); |
32 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 34 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
33 params.remove_standard_frame = true; | 35 params.remove_standard_frame = true; |
34 params.bounds = gfx::Rect(30, 30, 100, 100); | 36 params.bounds = gfx::Rect(30, 30, 100, 100); |
35 params.context = root_window(); | 37 params.context = root_window(); |
36 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 38 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
37 widget_->Init(params); | 39 widget_->Init(params); |
38 | 40 |
39 app_window_.set_web_view_for_testing(&web_view_); | 41 app_window_.set_web_view_for_testing(&web_view_); |
40 app_window_.set_window_for_testing(widget_.get()); | 42 app_window_.set_window_for_testing(widget_.get()); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ui::MouseEvent move(ui::ET_MOUSE_MOVED, | 222 ui::MouseEvent move(ui::ET_MOUSE_MOVED, |
221 gfx::Point(32, 37), gfx::Point(32, 37), | 223 gfx::Point(32, 37), gfx::Point(32, 37), |
222 ui::EF_NONE, ui::EF_NONE); | 224 ui::EF_NONE, ui::EF_NONE); |
223 ui::EventDispatchDetails details = | 225 ui::EventDispatchDetails details = |
224 event_processor()->OnEventFromSource(&move); | 226 event_processor()->OnEventFromSource(&move); |
225 ASSERT_FALSE(details.dispatcher_destroyed); | 227 ASSERT_FALSE(details.dispatcher_destroyed); |
226 EXPECT_EQ(window, move.target()); | 228 EXPECT_EQ(window, move.target()); |
227 } | 229 } |
228 #endif // defined (OS_CHROMEOS) | 230 #endif // defined (OS_CHROMEOS) |
229 } | 231 } |
OLD | NEW |