diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 02:57:09 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 02:57:09 +0000 |
commit | e8522294bd6a74d665fa8dabf7d8c71e747c67f8 (patch) | |
tree | 7d0bd3d5a20f77f9e8ac45745e77b8a29c1a90cc /ash/drag_drop/drag_drop_controller_unittest.cc | |
parent | ebd71961746ee354fee968c28870725408ce286b (diff) | |
download | chromium_src-e8522294bd6a74d665fa8dabf7d8c71e747c67f8.zip chromium_src-e8522294bd6a74d665fa8dabf7d8c71e747c67f8.tar.gz chromium_src-e8522294bd6a74d665fa8dabf7d8c71e747c67f8.tar.bz2 |
Fix leak in DragDrop test
cleanup: add virtual to virtual functions.
TBR=varunjain@chromium.org
BUG=164676,166862
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11642030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop/drag_drop_controller_unittest.cc')
-rw-r--r-- | ash/drag_drop/drag_drop_controller_unittest.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index 90b4084..2af2905 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -71,56 +71,56 @@ class DragTestView : public views::View { return ui::DragDropTypes::DRAG_COPY; } - void WriteDragData(const gfx::Point& p, OSExchangeData* data) OVERRIDE { + virtual void WriteDragData(const gfx::Point& p, + OSExchangeData* data) OVERRIDE { data->SetString(UTF8ToUTF16("I am being dragged")); - gfx::ImageSkiaRep* image = new gfx::ImageSkiaRep( - gfx::Size(10, 20), ui::SCALE_FACTOR_100P); - gfx::ImageSkia* image_skia = new gfx::ImageSkia(*image); + gfx::ImageSkiaRep image_rep(gfx::Size(10, 20), ui::SCALE_FACTOR_100P); + gfx::ImageSkia image_skia(image_rep); drag_utils::SetDragImageOnDataObject( - *image_skia, gfx::Size(image_skia->width(), image_skia->height()), - gfx::Vector2d(), data); + image_skia, image_skia.size(), gfx::Vector2d(), data); } - bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { + virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { return true; } - void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { + virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { if (event->type() == ui::ET_GESTURE_LONG_TAP) long_tap_received_ = true; return; } - bool GetDropFormats(int* formats, - std::set<OSExchangeData::CustomFormat>* custom_formats) { + virtual bool GetDropFormats( + int* formats, + std::set<OSExchangeData::CustomFormat>* custom_formats) { *formats = ui::OSExchangeData::STRING; return true; } - bool CanDrop(const OSExchangeData& data) OVERRIDE { + virtual bool CanDrop(const OSExchangeData& data) OVERRIDE { return true; } - void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE { + virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE { num_drag_enters_++; } - int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE { + virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE { num_drag_updates_++; return ui::DragDropTypes::DRAG_COPY; } - void OnDragExited() OVERRIDE { + virtual void OnDragExited() OVERRIDE { num_drag_exits_++; } - int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE { + virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE { num_drops_++; return ui::DragDropTypes::DRAG_COPY; } - void OnDragDone() OVERRIDE { + virtual void OnDragDone() OVERRIDE { drag_done_received_ = true; } |