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

Side by Side Diff: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc

Issue 261553002: Revert of Move DefaultActivationClient to wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
OLDNEW
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"
14 #include "ui/wm/core/easy_resize_window_targeter.h" 13 #include "ui/wm/core/easy_resize_window_targeter.h"
15 14
16 class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase { 15 class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
17 public: 16 public:
18 ShapedAppWindowTargeterTest() 17 ShapedAppWindowTargeterTest()
19 : web_view_(NULL) { 18 : web_view_(NULL) {
20 } 19 }
21 20
22 virtual ~ShapedAppWindowTargeterTest() {} 21 virtual ~ShapedAppWindowTargeterTest() {}
23 22
24 views::Widget* widget() { return widget_.get(); } 23 views::Widget* widget() { return widget_.get(); }
25 24
26 apps::NativeAppWindow* app_window() { return &app_window_; } 25 apps::NativeAppWindow* app_window() { return &app_window_; }
27 ChromeNativeAppWindowViews* app_window_views() { return &app_window_; } 26 ChromeNativeAppWindowViews* app_window_views() { return &app_window_; }
28 27
29 protected: 28 protected:
30 virtual void SetUp() OVERRIDE { 29 virtual void SetUp() OVERRIDE {
31 aura::test::AuraTestBase::SetUp(); 30 aura::test::AuraTestBase::SetUp();
32 new wm::DefaultActivationClient(root_window());
33 widget_.reset(new views::Widget); 31 widget_.reset(new views::Widget);
34 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 32 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
35 params.remove_standard_frame = true; 33 params.remove_standard_frame = true;
36 params.bounds = gfx::Rect(30, 30, 100, 100); 34 params.bounds = gfx::Rect(30, 30, 100, 100);
37 params.context = root_window(); 35 params.context = root_window();
38 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 36 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
39 widget_->Init(params); 37 widget_->Init(params);
40 38
41 app_window_.set_web_view_for_testing(&web_view_); 39 app_window_.set_web_view_for_testing(&web_view_);
42 app_window_.set_window_for_testing(widget_.get()); 40 app_window_.set_window_for_testing(widget_.get());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ui::MouseEvent move(ui::ET_MOUSE_MOVED, 220 ui::MouseEvent move(ui::ET_MOUSE_MOVED,
223 gfx::Point(32, 37), gfx::Point(32, 37), 221 gfx::Point(32, 37), gfx::Point(32, 37),
224 ui::EF_NONE, ui::EF_NONE); 222 ui::EF_NONE, ui::EF_NONE);
225 ui::EventDispatchDetails details = 223 ui::EventDispatchDetails details =
226 event_processor()->OnEventFromSource(&move); 224 event_processor()->OnEventFromSource(&move);
227 ASSERT_FALSE(details.dispatcher_destroyed); 225 ASSERT_FALSE(details.dispatcher_destroyed);
228 EXPECT_EQ(window, move.target()); 226 EXPECT_EQ(window, move.target());
229 } 227 }
230 #endif // defined (OS_CHROMEOS) 228 #endif // defined (OS_CHROMEOS)
231 } 229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698