OLD | NEW |
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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "ui/base/accelerators/accelerator.h" | 12 #include "ui/base/accelerators/accelerator.h" |
13 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
14 #include "ui/base/event.h" | 14 #include "ui/base/event.h" |
15 #include "ui/base/keycodes/keyboard_codes.h" | 15 #include "ui/base/keycodes/keyboard_codes.h" |
16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/base/models/simple_menu_model.h" | 17 #include "ui/base/models/simple_menu_model.h" |
18 #include "ui/compositor/compositor.h" | 18 #include "ui/compositor/compositor.h" |
19 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
20 #include "ui/compositor/layer_animator.h" | 20 #include "ui/compositor/layer_animator.h" |
21 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
22 #include "ui/gfx/path.h" | 22 #include "ui/gfx/path.h" |
23 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
24 #include "ui/views/background.h" | 24 #include "ui/views/background.h" |
25 #include "ui/views/controls/button/button_dropdown.h" | 25 #include "ui/views/controls/button/button_dropdown.h" |
26 #include "ui/views/controls/button/checkbox.h" | 26 #include "ui/views/controls/button/checkbox.h" |
27 #include "ui/views/controls/native/native_view_host.h" | 27 #include "ui/views/controls/native/native_view_host.h" |
28 #include "ui/views/controls/scroll_view.h" | 28 #include "ui/views/controls/scroll_view.h" |
29 #include "ui/views/controls/textfield/textfield.h" | 29 #include "ui/views/controls/textfield/textfield.h" |
30 #include "ui/views/events/event.h" | |
31 #include "ui/views/focus/accelerator_handler.h" | 30 #include "ui/views/focus/accelerator_handler.h" |
32 #include "ui/views/focus/view_storage.h" | 31 #include "ui/views/focus/view_storage.h" |
33 #include "ui/views/test/views_test_base.h" | 32 #include "ui/views/test/views_test_base.h" |
34 #include "ui/views/view.h" | 33 #include "ui/views/view.h" |
35 #include "ui/views/views_delegate.h" | 34 #include "ui/views/views_delegate.h" |
36 #include "ui/views/widget/native_widget.h" | 35 #include "ui/views/widget/native_widget.h" |
37 #include "ui/views/widget/root_view.h" | 36 #include "ui/views/widget/root_view.h" |
38 #include "ui/views/window/dialog_delegate.h" | 37 #include "ui/views/window/dialog_delegate.h" |
39 | 38 |
40 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 view->ReorderChildView(view_b, a); | 178 view->ReorderChildView(view_b, a); |
180 } | 179 } |
181 | 180 |
182 if (!view->layer() && base::RandDouble() < 0.1) | 181 if (!view->layer() && base::RandDouble() < 0.1) |
183 view->SetPaintToLayer(true); | 182 view->SetPaintToLayer(true); |
184 | 183 |
185 if (base::RandDouble() < 0.1) | 184 if (base::RandDouble() < 0.1) |
186 view->SetVisible(!view->visible()); | 185 view->SetVisible(!view->visible()); |
187 } | 186 } |
188 | 187 |
| 188 // Convenience to make constructing a GestureEvent simpler. |
| 189 class GestureEventForTest : public ui::GestureEvent { |
| 190 public: |
| 191 GestureEventForTest(ui::EventType type, int x, int y, int flags) |
| 192 : GestureEvent(type, x, y, flags, base::TimeDelta(), |
| 193 ui::GestureEventDetails(type, 0.0f, 0.0f), 0) { |
| 194 } |
| 195 |
| 196 private: |
| 197 DISALLOW_COPY_AND_ASSIGN(GestureEventForTest); |
| 198 }; |
| 199 |
189 } // namespace | 200 } // namespace |
190 | 201 |
191 namespace views { | 202 namespace views { |
192 | 203 |
193 typedef ViewsTestBase ViewTest; | 204 typedef ViewsTestBase ViewTest; |
194 | 205 |
195 // A derived class for testing purpose. | 206 // A derived class for testing purpose. |
196 class TestView : public View { | 207 class TestView : public View { |
197 public: | 208 public: |
198 TestView() : View(), delete_on_pressed_(false), in_touch_sequence_(false) {} | 209 TestView() : View(), delete_on_pressed_(false), in_touch_sequence_(false) {} |
(...skipping 13 matching lines...) Expand all Loading... |
212 last_clip_.setEmpty(); | 223 last_clip_.setEmpty(); |
213 accelerator_count_map_.clear(); | 224 accelerator_count_map_.clear(); |
214 } | 225 } |
215 | 226 |
216 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 227 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
217 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 228 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
218 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 229 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
219 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 230 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
220 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 231 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
221 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 232 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
222 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; | 233 virtual ui::TouchStatus OnTouchEvent(const ui::TouchEvent& event) OVERRIDE; |
223 // Ignores GestureEvent by default. | 234 // Ignores GestureEvent by default. |
224 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE; | 235 virtual ui::GestureStatus OnGestureEvent( |
| 236 const ui::GestureEvent& event) OVERRIDE; |
225 virtual void Paint(gfx::Canvas* canvas) OVERRIDE; | 237 virtual void Paint(gfx::Canvas* canvas) OVERRIDE; |
226 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 238 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; |
227 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 239 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
228 | 240 |
229 // OnBoundsChanged. | 241 // OnBoundsChanged. |
230 bool did_change_bounds_; | 242 bool did_change_bounds_; |
231 gfx::Rect new_bounds_; | 243 gfx::Rect new_bounds_; |
232 | 244 |
233 // MouseEvent. | 245 // MouseEvent. |
234 int last_mouse_event_type_; | 246 int last_mouse_event_type_; |
(...skipping 21 matching lines...) Expand all Loading... |
256 std::map<ui::Accelerator, int> accelerator_count_map_; | 268 std::map<ui::Accelerator, int> accelerator_count_map_; |
257 }; | 269 }; |
258 | 270 |
259 // A view subclass that ignores all touch events for testing purposes. | 271 // A view subclass that ignores all touch events for testing purposes. |
260 class TestViewIgnoreTouch : public TestView { | 272 class TestViewIgnoreTouch : public TestView { |
261 public: | 273 public: |
262 TestViewIgnoreTouch() : TestView() {} | 274 TestViewIgnoreTouch() : TestView() {} |
263 virtual ~TestViewIgnoreTouch() {} | 275 virtual ~TestViewIgnoreTouch() {} |
264 | 276 |
265 private: | 277 private: |
266 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; | 278 virtual ui::TouchStatus OnTouchEvent(const ui::TouchEvent& event) OVERRIDE; |
267 }; | 279 }; |
268 | 280 |
269 // A view subclass that consumes all Gesture events for testing purposes. | 281 // A view subclass that consumes all Gesture events for testing purposes. |
270 class TestViewConsumeGesture : public TestView { | 282 class TestViewConsumeGesture : public TestView { |
271 public: | 283 public: |
272 TestViewConsumeGesture() : TestView() {} | 284 TestViewConsumeGesture() : TestView() {} |
273 virtual ~TestViewConsumeGesture() {} | 285 virtual ~TestViewConsumeGesture() {} |
274 | 286 |
275 protected: | 287 protected: |
276 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE { | 288 virtual ui::GestureStatus OnGestureEvent( |
| 289 const ui::GestureEvent& event) OVERRIDE { |
277 last_gesture_event_type_ = event.type(); | 290 last_gesture_event_type_ = event.type(); |
278 location_.SetPoint(event.x(), event.y()); | 291 location_.SetPoint(event.x(), event.y()); |
279 return ui::GESTURE_STATUS_CONSUMED; | 292 return ui::GESTURE_STATUS_CONSUMED; |
280 } | 293 } |
281 | 294 |
282 private: | 295 private: |
283 DISALLOW_COPY_AND_ASSIGN(TestViewConsumeGesture); | 296 DISALLOW_COPY_AND_ASSIGN(TestViewConsumeGesture); |
284 }; | 297 }; |
285 | 298 |
286 // A view subclass that ignores all Gesture events. | 299 // A view subclass that ignores all Gesture events. |
287 class TestViewIgnoreGesture: public TestView { | 300 class TestViewIgnoreGesture: public TestView { |
288 public: | 301 public: |
289 TestViewIgnoreGesture() : TestView() {} | 302 TestViewIgnoreGesture() : TestView() {} |
290 virtual ~TestViewIgnoreGesture() {} | 303 virtual ~TestViewIgnoreGesture() {} |
291 | 304 |
292 private: | 305 private: |
293 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE { | 306 virtual ui::GestureStatus OnGestureEvent( |
| 307 const ui::GestureEvent& event) OVERRIDE { |
294 return ui::GESTURE_STATUS_UNKNOWN; | 308 return ui::GESTURE_STATUS_UNKNOWN; |
295 } | 309 } |
296 | 310 |
297 DISALLOW_COPY_AND_ASSIGN(TestViewIgnoreGesture); | 311 DISALLOW_COPY_AND_ASSIGN(TestViewIgnoreGesture); |
298 }; | 312 }; |
299 | 313 |
300 // A view subclass that ignores all scroll-gesture events, but consume all other | 314 // A view subclass that ignores all scroll-gesture events, but consume all other |
301 // gesture events. | 315 // gesture events. |
302 class TestViewIgnoreScrollGestures : public TestViewConsumeGesture { | 316 class TestViewIgnoreScrollGestures : public TestViewConsumeGesture { |
303 public: | 317 public: |
304 TestViewIgnoreScrollGestures() {} | 318 TestViewIgnoreScrollGestures() {} |
305 virtual ~TestViewIgnoreScrollGestures() {} | 319 virtual ~TestViewIgnoreScrollGestures() {} |
306 | 320 |
307 private: | 321 private: |
308 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE { | 322 virtual ui::GestureStatus OnGestureEvent( |
| 323 const ui::GestureEvent& event) OVERRIDE { |
309 if (event.IsScrollGestureEvent()) | 324 if (event.IsScrollGestureEvent()) |
310 return ui::GESTURE_STATUS_UNKNOWN; | 325 return ui::GESTURE_STATUS_UNKNOWN; |
311 return TestViewConsumeGesture::OnGestureEvent(event); | 326 return TestViewConsumeGesture::OnGestureEvent(event); |
312 } | 327 } |
313 | 328 |
314 DISALLOW_COPY_AND_ASSIGN(TestViewIgnoreScrollGestures); | 329 DISALLOW_COPY_AND_ASSIGN(TestViewIgnoreScrollGestures); |
315 }; | 330 }; |
316 | 331 |
317 //////////////////////////////////////////////////////////////////////////////// | 332 //////////////////////////////////////////////////////////////////////////////// |
318 // OnBoundsChanged | 333 // OnBoundsChanged |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ui::EF_LEFT_MOUSE_BUTTON); | 468 ui::EF_LEFT_MOUSE_BUTTON); |
454 root->OnMousePressed(pressed); | 469 root->OnMousePressed(pressed); |
455 EXPECT_EQ(0, v1->child_count()); | 470 EXPECT_EQ(0, v1->child_count()); |
456 | 471 |
457 widget->CloseNow(); | 472 widget->CloseNow(); |
458 } | 473 } |
459 | 474 |
460 //////////////////////////////////////////////////////////////////////////////// | 475 //////////////////////////////////////////////////////////////////////////////// |
461 // TouchEvent | 476 // TouchEvent |
462 //////////////////////////////////////////////////////////////////////////////// | 477 //////////////////////////////////////////////////////////////////////////////// |
463 ui::TouchStatus TestView::OnTouchEvent(const TouchEvent& event) { | 478 ui::TouchStatus TestView::OnTouchEvent(const ui::TouchEvent& event) { |
464 last_touch_event_type_ = event.type(); | 479 last_touch_event_type_ = event.type(); |
465 location_.SetPoint(event.x(), event.y()); | 480 location_.SetPoint(event.x(), event.y()); |
466 if (!in_touch_sequence_) { | 481 if (!in_touch_sequence_) { |
467 if (event.type() == ui::ET_TOUCH_PRESSED) { | 482 if (event.type() == ui::ET_TOUCH_PRESSED) { |
468 in_touch_sequence_ = true; | 483 in_touch_sequence_ = true; |
469 return ui::TOUCH_STATUS_START; | 484 return ui::TOUCH_STATUS_START; |
470 } | 485 } |
471 } else { | 486 } else { |
472 if (event.type() == ui::ET_TOUCH_RELEASED) { | 487 if (event.type() == ui::ET_TOUCH_RELEASED) { |
473 in_touch_sequence_ = false; | 488 in_touch_sequence_ = false; |
474 return ui::TOUCH_STATUS_END; | 489 return ui::TOUCH_STATUS_END; |
475 } | 490 } |
476 return ui::TOUCH_STATUS_CONTINUE; | 491 return ui::TOUCH_STATUS_CONTINUE; |
477 } | 492 } |
478 return last_touch_event_was_handled_ ? ui::TOUCH_STATUS_CONTINUE : | 493 return last_touch_event_was_handled_ ? ui::TOUCH_STATUS_CONTINUE : |
479 ui::TOUCH_STATUS_UNKNOWN; | 494 ui::TOUCH_STATUS_UNKNOWN; |
480 } | 495 } |
481 | 496 |
482 ui::TouchStatus TestViewIgnoreTouch::OnTouchEvent(const TouchEvent& event) { | 497 ui::TouchStatus TestViewIgnoreTouch::OnTouchEvent(const ui::TouchEvent& event) { |
483 return ui::TOUCH_STATUS_UNKNOWN; | 498 return ui::TOUCH_STATUS_UNKNOWN; |
484 } | 499 } |
485 | 500 |
486 TEST_F(ViewTest, TouchEvent) { | 501 TEST_F(ViewTest, TouchEvent) { |
487 TestView* v1 = new TestView(); | 502 TestView* v1 = new TestView(); |
488 v1->SetBoundsRect(gfx::Rect(0, 0, 300, 300)); | 503 v1->SetBoundsRect(gfx::Rect(0, 0, 300, 300)); |
489 | 504 |
490 TestView* v2 = new TestView(); | 505 TestView* v2 = new TestView(); |
491 v2->SetBoundsRect(gfx::Rect(100, 100, 100, 100)); | 506 v2->SetBoundsRect(gfx::Rect(100, 100, 100, 100)); |
492 | 507 |
(...skipping 12 matching lines...) Expand all Loading... |
505 v2->AddChildView(v3); | 520 v2->AddChildView(v3); |
506 | 521 |
507 // |v3| completely obscures |v2|, but all the touch events on |v3| should | 522 // |v3| completely obscures |v2|, but all the touch events on |v3| should |
508 // reach |v2| because |v3| doesn't process any touch events. | 523 // reach |v2| because |v3| doesn't process any touch events. |
509 | 524 |
510 // Make sure if none of the views handle the touch event, the gesture manager | 525 // Make sure if none of the views handle the touch event, the gesture manager |
511 // does. | 526 // does. |
512 v1->Reset(); | 527 v1->Reset(); |
513 v2->Reset(); | 528 v2->Reset(); |
514 | 529 |
515 TouchEvent unhandled(ui::ET_TOUCH_MOVED, | 530 ui::TestTouchEvent unhandled(ui::ET_TOUCH_MOVED, |
516 400, | 531 400, 400, |
517 400, | 532 0, /* no flags */ |
518 0, /* no flags */ | 533 0, /* first finger touch */ |
519 0, /* first finger touch */ | 534 1.0, 0.0, 1.0, 0.0); |
520 1.0, 0.0, 1.0, 0.0); | |
521 root->OnTouchEvent(unhandled); | 535 root->OnTouchEvent(unhandled); |
522 | 536 |
523 EXPECT_EQ(v1->last_touch_event_type_, 0); | 537 EXPECT_EQ(v1->last_touch_event_type_, 0); |
524 EXPECT_EQ(v2->last_touch_event_type_, 0); | 538 EXPECT_EQ(v2->last_touch_event_type_, 0); |
525 | 539 |
526 // Test press, drag, release touch sequence. | 540 // Test press, drag, release touch sequence. |
527 v1->Reset(); | 541 v1->Reset(); |
528 v2->Reset(); | 542 v2->Reset(); |
529 | 543 |
530 TouchEvent pressed(ui::ET_TOUCH_PRESSED, | 544 ui::TestTouchEvent pressed(ui::ET_TOUCH_PRESSED, |
531 110, | 545 110, 120, |
532 120, | 546 0, /* no flags */ |
533 0, /* no flags */ | 547 0, /* first finger touch */ |
534 0, /* first finger touch */ | 548 1.0, 0.0, 1.0, 0.0); |
535 1.0, 0.0, 1.0, 0.0); | |
536 v2->last_touch_event_was_handled_ = true; | 549 v2->last_touch_event_was_handled_ = true; |
537 root->OnTouchEvent(pressed); | 550 root->OnTouchEvent(pressed); |
538 | 551 |
539 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_PRESSED); | 552 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_PRESSED); |
540 EXPECT_EQ(v2->location_.x(), 10); | 553 EXPECT_EQ(v2->location_.x(), 10); |
541 EXPECT_EQ(v2->location_.y(), 20); | 554 EXPECT_EQ(v2->location_.y(), 20); |
542 // Make sure v1 did not receive the event | 555 // Make sure v1 did not receive the event |
543 EXPECT_EQ(v1->last_touch_event_type_, 0); | 556 EXPECT_EQ(v1->last_touch_event_type_, 0); |
544 | 557 |
545 // Drag event out of bounds. Should still go to v2 | 558 // Drag event out of bounds. Should still go to v2 |
546 v1->Reset(); | 559 v1->Reset(); |
547 v2->Reset(); | 560 v2->Reset(); |
548 TouchEvent dragged(ui::ET_TOUCH_MOVED, | 561 ui::TestTouchEvent dragged(ui::ET_TOUCH_MOVED, |
549 50, | 562 50, 40, |
550 40, | 563 0, /* no flags */ |
551 0, /* no flags */ | 564 0, /* first finger touch */ |
552 0, /* first finger touch */ | 565 1.0, 0.0, 1.0, 0.0); |
553 1.0, 0.0, 1.0, 0.0); | |
554 | 566 |
555 root->OnTouchEvent(dragged); | 567 root->OnTouchEvent(dragged); |
556 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_MOVED); | 568 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_MOVED); |
557 EXPECT_EQ(v2->location_.x(), -50); | 569 EXPECT_EQ(v2->location_.x(), -50); |
558 EXPECT_EQ(v2->location_.y(), -60); | 570 EXPECT_EQ(v2->location_.y(), -60); |
559 // Make sure v1 did not receive the event | 571 // Make sure v1 did not receive the event |
560 EXPECT_EQ(v1->last_touch_event_type_, 0); | 572 EXPECT_EQ(v1->last_touch_event_type_, 0); |
561 | 573 |
562 // Released event out of bounds. Should still go to v2 | 574 // Released event out of bounds. Should still go to v2 |
563 v1->Reset(); | 575 v1->Reset(); |
564 v2->Reset(); | 576 v2->Reset(); |
565 TouchEvent released(ui::ET_TOUCH_RELEASED, 0, 0, 0, 0 /* first finger */, | 577 ui::TestTouchEvent released(ui::ET_TOUCH_RELEASED, 0, 0, |
566 1.0, 0.0, 1.0, 0.0); | 578 0, /* no flags */ |
| 579 0, /* first finger */ |
| 580 1.0, 0.0, 1.0, 0.0); |
567 v2->last_touch_event_was_handled_ = true; | 581 v2->last_touch_event_was_handled_ = true; |
568 root->OnTouchEvent(released); | 582 root->OnTouchEvent(released); |
569 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_RELEASED); | 583 EXPECT_EQ(v2->last_touch_event_type_, ui::ET_TOUCH_RELEASED); |
570 EXPECT_EQ(v2->location_.x(), -100); | 584 EXPECT_EQ(v2->location_.x(), -100); |
571 EXPECT_EQ(v2->location_.y(), -100); | 585 EXPECT_EQ(v2->location_.y(), -100); |
572 // Make sure v1 did not receive the event | 586 // Make sure v1 did not receive the event |
573 EXPECT_EQ(v1->last_touch_event_type_, 0); | 587 EXPECT_EQ(v1->last_touch_event_type_, 0); |
574 | 588 |
575 widget->CloseNow(); | 589 widget->CloseNow(); |
576 } | 590 } |
577 | 591 |
578 ui::GestureStatus TestView::OnGestureEvent(const GestureEvent& event) { | 592 ui::GestureStatus TestView::OnGestureEvent(const ui::GestureEvent& event) { |
579 return ui::GESTURE_STATUS_UNKNOWN; | 593 return ui::GESTURE_STATUS_UNKNOWN; |
580 } | 594 } |
581 | 595 |
582 TEST_F(ViewTest, GestureEvent) { | 596 TEST_F(ViewTest, GestureEvent) { |
583 // Views hierarchy for non delivery of GestureEvent. | 597 // Views hierarchy for non delivery of GestureEvent. |
584 TestView* v1 = new TestViewConsumeGesture(); | 598 TestView* v1 = new TestViewConsumeGesture(); |
585 v1->SetBoundsRect(gfx::Rect(0, 0, 300, 300)); | 599 v1->SetBoundsRect(gfx::Rect(0, 0, 300, 300)); |
586 | 600 |
587 TestView* v2 = new TestViewConsumeGesture(); | 601 TestView* v2 = new TestViewConsumeGesture(); |
588 v2->SetBoundsRect(gfx::Rect(100, 100, 100, 100)); | 602 v2->SetBoundsRect(gfx::Rect(100, 100, 100, 100)); |
(...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 // Set to non default value. | 3381 // Set to non default value. |
3368 v->layer()->set_scale_content(false); | 3382 v->layer()->set_scale_content(false); |
3369 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); | 3383 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); |
3370 ui::Layer* new_layer = v->layer(); | 3384 ui::Layer* new_layer = v->layer(); |
3371 EXPECT_FALSE(new_layer->scale_content()); | 3385 EXPECT_FALSE(new_layer->scale_content()); |
3372 } | 3386 } |
3373 | 3387 |
3374 #endif // USE_AURA | 3388 #endif // USE_AURA |
3375 | 3389 |
3376 } // namespace views | 3390 } // namespace views |
OLD | NEW |