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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 9452024: Gestures are now possible using touch events with any ids (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Ignore events which haven't been preceded by a press. Fix pinch. Created 8 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 511
512 window->ReleaseCapture(); 512 window->ReleaseCapture();
513 EXPECT_FALSE(window->HasCapture()); 513 EXPECT_FALSE(window->HasCapture());
514 EXPECT_EQ(1, delegate.capture_lost_count()); 514 EXPECT_EQ(1, delegate.capture_lost_count());
515 EXPECT_EQ(1, delegate.capture_changed_event_count()); 515 EXPECT_EQ(1, delegate.capture_changed_event_count());
516 EXPECT_EQ(1, delegate.mouse_event_count()); 516 EXPECT_EQ(1, delegate.mouse_event_count());
517 517
518 generator.PressLeftButton(); 518 generator.PressLeftButton();
519 EXPECT_EQ(1, delegate.mouse_event_count()); 519 EXPECT_EQ(1, delegate.mouse_event_count());
520 520
521 root_window()->DispatchTouchEvent(&touchev); 521 TouchEvent touchev2(ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 1);
522 root_window()->DispatchTouchEvent(&touchev2);
522 EXPECT_EQ(0, delegate.touch_event_count()); 523 EXPECT_EQ(0, delegate.touch_event_count());
523 524
524 // Removing the capture window from parent should reset the capture window 525 // Removing the capture window from parent should reset the capture window
525 // in the root window. 526 // in the root window.
526 window->SetCapture(); 527 window->SetCapture();
527 EXPECT_EQ(window.get(), root_window()->capture_window()); 528 EXPECT_EQ(window.get(), root_window()->capture_window());
528 window->parent()->RemoveChild(window.get()); 529 window->parent()->RemoveChild(window.get());
529 EXPECT_FALSE(window->HasCapture()); 530 EXPECT_FALSE(window->HasCapture());
530 EXPECT_EQ(NULL, root_window()->capture_window()); 531 EXPECT_EQ(NULL, root_window()->capture_window());
531 } 532 }
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 1722
1722 w1.reset(); // Deletes w11 and w111. 1723 w1.reset(); // Deletes w11 and w111.
1723 w11 = NULL; 1724 w11 = NULL;
1724 w111 = NULL; 1725 w111 = NULL;
1725 EXPECT_EQ(2, observer.added_count()); 1726 EXPECT_EQ(2, observer.added_count());
1726 EXPECT_EQ(2, observer.removed_count()); 1727 EXPECT_EQ(2, observer.removed_count());
1727 } 1728 }
1728 1729
1729 } // namespace test 1730 } // namespace test
1730 } // namespace aura 1731 } // namespace aura
OLDNEW
« ui/aura/gestures/gesture_sequence.cc ('K') | « ui/aura/gestures/gesture_sequence.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698