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

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

Issue 11086037: Revert 160976 - The center of a rect is x+width/2, y+height/2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/gfx/rect_base_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/aura/client/event_client.h" 10 #include "ui/aura/client/event_client.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 client.GetNonLockWindow()->SetEventFilter(nonlock_ef); 353 client.GetNonLockWindow()->SetEventFilter(nonlock_ef);
354 client.GetLockWindow()->SetEventFilter(lock_ef); 354 client.GetLockWindow()->SetEventFilter(lock_ef);
355 355
356 Window* w1 = test::CreateTestWindowWithBounds(gfx::Rect(10, 10, 20, 20), 356 Window* w1 = test::CreateTestWindowWithBounds(gfx::Rect(10, 10, 20, 20),
357 client.GetNonLockWindow()); 357 client.GetNonLockWindow());
358 w1->set_id(1); 358 w1->set_id(1);
359 Window* w2 = test::CreateTestWindowWithBounds(gfx::Rect(30, 30, 20, 20), 359 Window* w2 = test::CreateTestWindowWithBounds(gfx::Rect(30, 30, 20, 20),
360 client.GetNonLockWindow()); 360 client.GetNonLockWindow());
361 w2->set_id(2); 361 w2->set_id(2);
362 scoped_ptr<Window> w3( 362 scoped_ptr<Window> w3(
363 test::CreateTestWindowWithDelegate(&d, 3, gfx::Rect(30, 30, 20, 20), 363 test::CreateTestWindowWithDelegate(&d, 3, gfx::Rect(20, 20, 20, 20),
364 client.GetLockWindow())); 364 client.GetLockWindow()));
365 365
366 w1->Focus(); 366 w1->Focus();
367 EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1)); 367 EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1));
368 368
369 client.Lock(); 369 client.Lock();
370 370
371 // Since we're locked, the attempt to focus w2 will be ignored. 371 // Since we're locked, the attempt to focus w2 will be ignored.
372 w2->Focus(); 372 w2->Focus();
373 EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1)); 373 EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1));
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 TEST_F(RootWindowTest, GestureRecognizerResetsTargetWhenParentHides) { 774 TEST_F(RootWindowTest, GestureRecognizerResetsTargetWhenParentHides) {
775 scoped_ptr<Window> w1(CreateWindow(1, root_window(), NULL)); 775 scoped_ptr<Window> w1(CreateWindow(1, root_window(), NULL));
776 DetachesParentOnTapDelegate delegate; 776 DetachesParentOnTapDelegate delegate;
777 scoped_ptr<Window> parent(CreateWindow(22, w1.get(), NULL)); 777 scoped_ptr<Window> parent(CreateWindow(22, w1.get(), NULL));
778 Window* child = CreateWindow(11, parent.get(), &delegate); 778 Window* child = CreateWindow(11, parent.get(), &delegate);
779 test::EventGenerator generator(root_window(), child); 779 test::EventGenerator generator(root_window(), child);
780 generator.GestureTapAt(gfx::Point(40, 40)); 780 generator.GestureTapAt(gfx::Point(40, 40));
781 } 781 }
782 782
783 } // namespace aura 783 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/gfx/rect_base_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698