| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 14 #include "ui/base/dragdrop/drag_drop_types.h" | 14 #include "ui/base/dragdrop/drag_drop_types.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/base/test/ui_controls.h" | 16 #include "ui/base/test/ui_controls.h" |
| 17 #include "ui/base/ui_base_paths.h" | 17 #include "ui/base/ui_base_paths.h" |
| 18 #include "ui/events/platform/platform_event_source.h" |
| 18 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 19 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
| 20 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
| 21 | 22 |
| 22 namespace ash { | 23 namespace ash { |
| 23 namespace internal { | 24 namespace internal { |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| 26 class DraggableView : public views::View { | 27 class DraggableView : public views::View { |
| 27 public: | 28 public: |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 133 |
| 133 ui::RegisterPathProvider(); | 134 ui::RegisterPathProvider(); |
| 134 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 135 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 135 base::FilePath resources_pack_path; | 136 base::FilePath resources_pack_path; |
| 136 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 137 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 137 resources_pack_path = | 138 resources_pack_path = |
| 138 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 139 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 139 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 140 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 140 resources_pack_path, ui::SCALE_FACTOR_NONE); | 141 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 141 | 142 |
| 143 event_source_ = ui::PlatformEventSource::CreateDefault(); |
| 142 test::AshTestBase::SetUp(); | 144 test::AshTestBase::SetUp(); |
| 143 } | 145 } |
| 146 |
| 147 private: |
| 148 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(DragDropTest); |
| 144 }; | 151 }; |
| 145 | 152 |
| 146 #if defined(OS_WIN) | 153 #if defined(OS_WIN) |
| 147 #define MAYBE_DragDropAcrossMultiDisplay DISABLED_DragDropAcrossMultiDisplay | 154 #define MAYBE_DragDropAcrossMultiDisplay DISABLED_DragDropAcrossMultiDisplay |
| 148 #else | 155 #else |
| 149 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay | 156 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay |
| 150 #endif | 157 #endif |
| 151 | 158 |
| 152 // Test if the mouse gets moved properly to another display | 159 // Test if the mouse gets moved properly to another display |
| 153 // during drag & drop operation. | 160 // during drag & drop operation. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 179 base::MessageLoop::current()->Run(); | 186 base::MessageLoop::current()->Run(); |
| 180 | 187 |
| 181 EXPECT_TRUE(target_view->dropped()); | 188 EXPECT_TRUE(target_view->dropped()); |
| 182 | 189 |
| 183 source->Close(); | 190 source->Close(); |
| 184 target->Close(); | 191 target->Close(); |
| 185 } | 192 } |
| 186 | 193 |
| 187 } // namespace internal | 194 } // namespace internal |
| 188 } // namespace ash | 195 } // namespace ash |
| OLD | NEW |