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

Side by Side Diff: chrome/browser/ui/panels/panel_mouse_watcher_unittest.cc

Issue 392013005: [#1] Delete reduntdant 19 header files in ui/gfx (8 of 19 by this) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sorted includes Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" 7 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
8 #include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h" 8 #include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/geometry/point.h"
11 11
12 class TestMouseObserver : public PanelMouseWatcherObserver { 12 class TestMouseObserver : public PanelMouseWatcherObserver {
13 public: 13 public:
14 TestMouseObserver() : mouse_movements_(0) {} 14 TestMouseObserver() : mouse_movements_(0) {}
15 // Overridden from PanelMouseWatcherObserver: 15 // Overridden from PanelMouseWatcherObserver:
16 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE { 16 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE {
17 ++mouse_movements_; 17 ++mouse_movements_;
18 } 18 }
19 int mouse_movements_; 19 int mouse_movements_;
20 }; 20 };
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Back to one observer. 56 // Back to one observer.
57 watcher->RemoveObserver(user1.get()); 57 watcher->RemoveObserver(user1.get());
58 EXPECT_TRUE(watcher->IsActive()); 58 EXPECT_TRUE(watcher->IsActive());
59 int saved_count = user1->mouse_movements_; 59 int saved_count = user1->mouse_movements_;
60 watcher->NotifyMouseMovement(gfx::Point(1, 2)); 60 watcher->NotifyMouseMovement(gfx::Point(1, 2));
61 EXPECT_EQ(saved_count, user1->mouse_movements_); 61 EXPECT_EQ(saved_count, user1->mouse_movements_);
62 EXPECT_GE(user2->mouse_movements_, 2); 62 EXPECT_GE(user2->mouse_movements_, 2);
63 watcher->RemoveObserver(user2.get()); 63 watcher->RemoveObserver(user2.get());
64 EXPECT_FALSE(watcher->IsActive()); 64 EXPECT_FALSE(watcher->IsActive());
65 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698