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

Side by Side Diff: motion_event_coalescer_test.cc

Issue 6902072: wm: Update a lot of code to use structs from geometry.h. (Closed) Base URL: ssh://gitrw.chromium.org:9222/window_manager.git@master
Patch Set: move override-redirect stacking and visibility into Window Created 9 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 (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <gflags/gflags.h> 5 #include <gflags/gflags.h>
6 #include <gtest/gtest.h> 6 #include <gtest/gtest.h>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "window_manager/callback.h" 9 #include "window_manager/callback.h"
10 #include "window_manager/event_loop.h" 10 #include "window_manager/event_loop.h"
(...skipping 21 matching lines...) Expand all
32 &event_loop, 32 &event_loop,
33 NewPermanentCallback(&counter, &TestCallbackCounter::Increment), 33 NewPermanentCallback(&counter, &TestCallbackCounter::Increment),
34 100); 34 100);
35 coalescer.set_synchronous(true); 35 coalescer.set_synchronous(true);
36 36
37 coalescer.Start(); 37 coalescer.Start();
38 EXPECT_EQ(0, counter.num_calls()); 38 EXPECT_EQ(0, counter.num_calls());
39 39
40 // We used to initialize the positions to (0, 0) instead of (-1, -1), so 40 // We used to initialize the positions to (0, 0) instead of (-1, -1), so
41 // we'd incorrectly ignore initial (0, 0) values. 41 // we'd incorrectly ignore initial (0, 0) values.
42 coalescer.StorePosition(0, 0); 42 coalescer.StorePosition(Point(0, 0));
43 EXPECT_EQ(1, counter.num_calls()); 43 EXPECT_EQ(1, counter.num_calls());
44 EXPECT_EQ(0, coalescer.x()); 44 EXPECT_EQ(0, coalescer.x());
45 EXPECT_EQ(0, coalescer.y()); 45 EXPECT_EQ(0, coalescer.y());
46 46
47 coalescer.StorePosition(200, 300); 47 coalescer.StorePosition(Point(200, 300));
48 EXPECT_EQ(2, counter.num_calls()); 48 EXPECT_EQ(2, counter.num_calls());
49 EXPECT_EQ(200, coalescer.x()); 49 EXPECT_EQ(200, coalescer.x());
50 EXPECT_EQ(300, coalescer.y()); 50 EXPECT_EQ(300, coalescer.y());
51 51
52 coalescer.Stop(); 52 coalescer.Stop();
53 EXPECT_EQ(2, counter.num_calls()); 53 EXPECT_EQ(2, counter.num_calls());
54 54
55 coalescer.Start(); 55 coalescer.Start();
56 EXPECT_EQ(2, counter.num_calls()); 56 EXPECT_EQ(2, counter.num_calls());
57 57
58 // We should still notify if the first values that we receive after 58 // We should still notify if the first values that we receive after
59 // restarting matched the last ones that we saw before. 59 // restarting matched the last ones that we saw before.
60 coalescer.StorePosition(200, 300); 60 coalescer.StorePosition(Point(200, 300));
61 EXPECT_EQ(3, counter.num_calls()); 61 EXPECT_EQ(3, counter.num_calls());
62 EXPECT_EQ(200, coalescer.x()); 62 EXPECT_EQ(200, coalescer.x());
63 EXPECT_EQ(300, coalescer.y()); 63 EXPECT_EQ(300, coalescer.y());
64 } 64 }
65 65
66 } // namespace window_manager 66 } // namespace window_manager
67 67
68 int main(int argc, char** argv) { 68 int main(int argc, char** argv) {
69 return window_manager::InitAndRunTests(&argc, argv, &FLAGS_logtostderr); 69 return window_manager::InitAndRunTests(&argc, argv, &FLAGS_logtostderr);
70 } 70 }
OLDNEW
« no previous file with comments | « motion_event_coalescer.cc ('k') | panels/panel.h » ('j') | window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698