| 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 "chrome/browser/ui/views/apps/native_app_window_views.h" | 7 #include "chrome/browser/ui/views/apps/native_app_window_views.h" |
| 8 #include "ui/aura/test/aura_test_base.h" | 8 #include "ui/aura/test/aura_test_base.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 virtual void SetUp() OVERRIDE { | 28 virtual void SetUp() OVERRIDE { |
| 29 aura::test::AuraTestBase::SetUp(); | 29 aura::test::AuraTestBase::SetUp(); |
| 30 widget_.reset(new views::Widget); | 30 widget_.reset(new views::Widget); |
| 31 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 31 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 32 params.remove_standard_frame = true; | 32 params.remove_standard_frame = true; |
| 33 params.bounds = gfx::Rect(30, 30, 100, 100); | 33 params.bounds = gfx::Rect(30, 30, 100, 100); |
| 34 params.context = root_window(); | 34 params.context = root_window(); |
| 35 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 35 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 36 widget_->Init(params); | 36 widget_->Init(params); |
| 37 | 37 |
| 38 app_window_.web_view_ = &web_view_; | 38 app_window_.set_web_view_for_testing(&web_view_); |
| 39 app_window_.window_ = widget_.get(); | 39 app_window_.set_window_for_testing(widget_.get()); |
| 40 | 40 |
| 41 widget_->Show(); | 41 widget_->Show(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual void TearDown() OVERRIDE { | 44 virtual void TearDown() OVERRIDE { |
| 45 widget_.reset(); | 45 widget_.reset(); |
| 46 aura::test::AuraTestBase::TearDown(); | 46 aura::test::AuraTestBase::TearDown(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 private: | 49 private: |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // inside the window and within 5px of an edge should have | 194 // inside the window and within 5px of an edge should have |
| 195 // root_window() as its target. | 195 // root_window() as its target. |
| 196 ui::MouseEvent move(ui::ET_MOUSE_MOVED, | 196 ui::MouseEvent move(ui::ET_MOUSE_MOVED, |
| 197 gfx::Point(32, 37), gfx::Point(32, 37), | 197 gfx::Point(32, 37), gfx::Point(32, 37), |
| 198 ui::EF_NONE, ui::EF_NONE); | 198 ui::EF_NONE, ui::EF_NONE); |
| 199 ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); | 199 ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); |
| 200 ASSERT_FALSE(details.dispatcher_destroyed); | 200 ASSERT_FALSE(details.dispatcher_destroyed); |
| 201 EXPECT_EQ(root_window(), move.target()); | 201 EXPECT_EQ(root_window(), move.target()); |
| 202 } | 202 } |
| 203 } | 203 } |
| OLD | NEW |