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 "chrome/browser/ui/views/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" | 8 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" |
9 #include "chrome/browser/ui/views/tabs/tab.h" | 9 #include "chrome/browser/ui/views/tabs/tab.h" |
10 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 10 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 | 309 |
310 // Now tabs have the immersive height. | 310 // Now tabs have the immersive height. |
311 int immersive_height = Tab::GetImmersiveHeight(); | 311 int immersive_height = Tab::GetImmersiveHeight(); |
312 EXPECT_EQ(immersive_height, tab_strip_->GetPreferredSize().height()); | 312 EXPECT_EQ(immersive_height, tab_strip_->GetPreferredSize().height()); |
313 | 313 |
314 // Sanity-check immersive tabs are shorter than normal tabs. | 314 // Sanity-check immersive tabs are shorter than normal tabs. |
315 EXPECT_LT(immersive_height, normal_height); | 315 EXPECT_LT(immersive_height, normal_height); |
316 } | 316 } |
317 | 317 |
318 // Creates a tab strip in stacked layout mode and verifies the correctness | 318 // Creates a tab strip in stacked layout mode and verifies the correctness |
319 // of hit tests against the visible/occluded regions of a tab and | 319 // of hit tests against the visible/occluded regions of a tab and the tab |
320 // visible/occluded tab close buttons. | 320 // close button of the active tab. |
321 TEST_F(TabStripTest, TabHitTestMaskWhenStacked) { | 321 TEST_F(TabStripTest, TabHitTestMaskWhenStacked) { |
322 tab_strip_->SetBounds(0, 0, 300, 20); | 322 tab_strip_->SetBounds(0, 0, 300, 20); |
323 | 323 |
324 controller_->AddTab(0, false); | 324 controller_->AddTab(0, false); |
325 controller_->AddTab(1, true); | 325 controller_->AddTab(1, true); |
326 controller_->AddTab(2, false); | 326 controller_->AddTab(2, false); |
327 controller_->AddTab(3, false); | 327 controller_->AddTab(3, false); |
328 ASSERT_EQ(4, tab_strip_->tab_count()); | 328 ASSERT_EQ(4, tab_strip_->tab_count()); |
329 | 329 |
330 Tab* left_tab = tab_strip_->tab_at(0); | 330 Tab* left_tab = tab_strip_->tab_at(0); |
331 left_tab->SetBoundsRect(gfx::Rect(gfx::Point(0, 0), gfx::Size(200, 20))); | 331 left_tab->SetBoundsRect(gfx::Rect(gfx::Point(0, 0), gfx::Size(200, 20))); |
332 | 332 |
333 Tab* active_tab = tab_strip_->tab_at(1); | 333 Tab* active_tab = tab_strip_->tab_at(1); |
334 active_tab->SetBoundsRect(gfx::Rect(gfx::Point(150, 0), gfx::Size(200, 20))); | 334 active_tab->SetBoundsRect(gfx::Rect(gfx::Point(150, 0), gfx::Size(200, 20))); |
335 ASSERT_TRUE(active_tab->IsActive()); | 335 ASSERT_TRUE(active_tab->IsActive()); |
336 | 336 |
337 Tab* right_tab = tab_strip_->tab_at(2); | 337 Tab* right_tab = tab_strip_->tab_at(2); |
338 right_tab->SetBoundsRect(gfx::Rect(gfx::Point(300, 0), gfx::Size(200, 20))); | 338 right_tab->SetBoundsRect(gfx::Rect(gfx::Point(300, 0), gfx::Size(200, 20))); |
339 | 339 |
340 Tab* most_right_tab = tab_strip_->tab_at(3); | 340 Tab* most_right_tab = tab_strip_->tab_at(3); |
341 most_right_tab->SetBoundsRect(gfx::Rect(gfx::Point(450, 0), | 341 most_right_tab->SetBoundsRect(gfx::Rect(gfx::Point(450, 0), |
342 gfx::Size(200, 20))); | 342 gfx::Size(200, 20))); |
343 | 343 |
344 // Switch to stacked layout mode and force a layout to ensure tabs stack. | 344 // Switch to stacked layout mode and force a layout to ensure tabs stack. |
345 tab_strip_->SetStackedLayout(true); | 345 tab_strip_->SetStackedLayout(true); |
346 tab_strip_->DoLayout(); | 346 tab_strip_->DoLayout(); |
347 | 347 |
348 | 348 |
349 // Tests involving |left_tab|, which has part of its bounds and its tab | 349 // Tests involving |left_tab|, which has part of its bounds occluded by |
350 // close button completely occluded by |active_tab|. | 350 // |active_tab|. |
351 | 351 |
352 // Bounds of the tab's hit test mask. | 352 // Bounds of the tab's hit test mask. |
353 gfx::Rect tab_bounds = GetTabHitTestMask(left_tab); | 353 gfx::Rect tab_bounds = GetTabHitTestMask(left_tab); |
354 EXPECT_EQ(gfx::Rect(6, 2, 61, 27).ToString(), tab_bounds.ToString()); | 354 EXPECT_EQ(gfx::Rect(6, 2, 61, 27).ToString(), tab_bounds.ToString()); |
355 | 355 |
356 // Bounds of the tab close button (without padding) in the tab's | |
357 // coordinate space. | |
358 gfx::Rect contents_bounds = GetTabCloseHitTestMask(left_tab, false); | |
359 // TODO(tdanderson): Uncomment this line once crbug.com/311609 is resolved. | |
360 //EXPECT_EQ(gfx::Rect(84, 8, 18, 18).ToString(), contents_bounds.ToString()); | |
361 | |
362 // Verify that the tab close button is completely occluded. | |
363 EXPECT_FALSE(tab_bounds.Contains(contents_bounds)); | |
364 | |
365 // Hit tests in the non-occuluded region of the tab. | 356 // Hit tests in the non-occuluded region of the tab. |
366 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(6, 2, 2, 2))); | 357 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(6, 2, 2, 2))); |
367 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(6, 2, 1, 1))); | 358 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(6, 2, 1, 1))); |
368 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(30, 15, 1, 1))); | 359 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(30, 15, 1, 1))); |
369 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(30, 15, 25, 35))); | 360 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(30, 15, 25, 35))); |
370 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(-10, -5, 20, 30))); | 361 EXPECT_TRUE(left_tab->HitTestRect(gfx::Rect(-10, -5, 20, 30))); |
371 | 362 |
372 // Hit tests in the occluded region of the tab. | 363 // Hit tests in the occluded region of the tab. |
373 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(70, 15, 2, 2))); | 364 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(70, 15, 2, 2))); |
374 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(70, -15, 30, 40))); | 365 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(70, -15, 30, 40))); |
375 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(87, 20, 5, 3))); | 366 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(87, 20, 5, 3))); |
376 | 367 |
377 // Hit tests completely outside of the tab. | 368 // Hit tests completely outside of the tab. |
378 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(-20, -25, 1, 1))); | 369 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(-20, -25, 1, 1))); |
379 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(-20, -25, 3, 19))); | 370 EXPECT_FALSE(left_tab->HitTestRect(gfx::Rect(-20, -25, 3, 19))); |
380 | 371 |
381 // All hit tests against the tab close button should fail because | |
382 // it is occluded by |active_tab|. | |
383 views::ImageButton* left_close = left_tab->close_button_; | |
384 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(1, 1, 1, 1))); | |
385 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(1, 1, 5, 10))); | |
386 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(10, 10, 1, 1))); | |
387 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(10, 10, 3, 4))); | |
388 | |
389 | 372 |
390 // Tests involving |active_tab|, which is completely visible. | 373 // Tests involving |active_tab|, which is completely visible. |
391 | 374 |
392 tab_bounds = GetTabHitTestMask(active_tab); | 375 tab_bounds = GetTabHitTestMask(active_tab); |
393 EXPECT_EQ(gfx::Rect(6, 2, 108, 27).ToString(), tab_bounds.ToString()); | 376 EXPECT_EQ(gfx::Rect(6, 2, 108, 27).ToString(), tab_bounds.ToString()); |
394 contents_bounds = GetTabCloseHitTestMask(active_tab, false); | 377 gfx::Rect contents_bounds = GetTabCloseHitTestMask(active_tab, false); |
395 // TODO(tdanderson): Uncomment this line once crbug.com/311609 is resolved. | 378 // TODO(tdanderson): Uncomment this line once crbug.com/311609 is resolved. |
396 //EXPECT_EQ(gfx::Rect(84, 8, 18, 18).ToString(), contents_bounds.ToString()); | 379 // EXPECT_EQ(gfx::Rect(84, 8, 18, 18).ToString(), contents_bounds.ToString()); |
397 | 380 |
398 // Verify that the tab close button is not occluded. | 381 // Verify that the tab close button is not occluded. |
399 EXPECT_TRUE(tab_bounds.Contains(contents_bounds)); | 382 EXPECT_TRUE(tab_bounds.Contains(contents_bounds)); |
400 | 383 |
401 // Bounds of the tab close button (without padding) in the tab's | 384 // Bounds of the tab close button (without padding) in the tab's |
402 // coordinate space. | 385 // coordinate space. |
403 gfx::Rect local_bounds = GetTabCloseHitTestMask(active_tab, true); | 386 gfx::Rect local_bounds = GetTabCloseHitTestMask(active_tab, true); |
404 EXPECT_EQ(gfx::Rect(81, 0, 39, 29).ToString(), local_bounds.ToString()); | 387 EXPECT_EQ(gfx::Rect(81, 0, 39, 29).ToString(), local_bounds.ToString()); |
405 | 388 |
406 // Hit tests within the tab. | 389 // Hit tests within the tab. |
407 EXPECT_TRUE(active_tab->HitTestRect(gfx::Rect(30, 15, 1, 1))); | 390 EXPECT_TRUE(active_tab->HitTestRect(gfx::Rect(30, 15, 1, 1))); |
408 EXPECT_TRUE(active_tab->HitTestRect(gfx::Rect(30, 15, 2, 2))); | 391 EXPECT_TRUE(active_tab->HitTestRect(gfx::Rect(30, 15, 2, 2))); |
409 | 392 |
410 // Hit tests against the tab close button. Note that hit tests from either | 393 // Hit tests against the tab close button. Note that hit tests from either |
411 // mouse or touch should both fail if they are strictly contained within | 394 // mouse or touch should both fail if they are strictly contained within |
412 // the button's padding. | 395 // the button's padding. |
413 views::ImageButton* active_close = active_tab->close_button_; | 396 views::ImageButton* active_close = active_tab->close_button_; |
414 EXPECT_FALSE(active_close->HitTestRect(gfx::Rect(1, 1, 1, 1))); | 397 EXPECT_FALSE(active_close->HitTestRect(gfx::Rect(1, 1, 1, 1))); |
415 EXPECT_FALSE(active_close->HitTestRect(gfx::Rect(1, 1, 2, 2))); | 398 EXPECT_FALSE(active_close->HitTestRect(gfx::Rect(1, 1, 2, 2))); |
416 EXPECT_TRUE(active_close->HitTestRect(gfx::Rect(10, 10, 1, 1))); | 399 EXPECT_TRUE(active_close->HitTestRect(gfx::Rect(10, 10, 1, 1))); |
417 EXPECT_TRUE(active_close->HitTestRect(gfx::Rect(10, 10, 25, 35))); | 400 EXPECT_TRUE(active_close->HitTestRect(gfx::Rect(10, 10, 25, 35))); |
418 | 401 |
419 | 402 |
420 // Tests involving |most_right_tab|, which has part of its bounds occluded | 403 // Tests involving |most_right_tab|, which has part of its bounds occluded |
421 // by |right_tab| but has its tab close button completely visible. | 404 // by |right_tab|. |
422 | 405 |
423 tab_bounds = GetTabHitTestMask(most_right_tab); | 406 tab_bounds = GetTabHitTestMask(most_right_tab); |
424 EXPECT_EQ(gfx::Rect(84, 2, 30, 27).ToString(), tab_bounds.ToString()); | 407 EXPECT_EQ(gfx::Rect(84, 2, 30, 27).ToString(), tab_bounds.ToString()); |
425 contents_bounds = GetTabCloseHitTestMask(active_tab, false); | |
426 // TODO(tdanderson): Uncomment this line once crbug.com/311609 is resolved. | |
427 //EXPECT_EQ(gfx::Rect(84, 8, 18, 18).ToString(), contents_bounds.ToString()); | |
428 local_bounds = GetTabCloseHitTestMask(active_tab, true); | |
429 EXPECT_EQ(gfx::Rect(81, 0, 39, 29).ToString(), local_bounds.ToString()); | |
430 | |
431 // Verify that the tab close button is not occluded. | |
432 EXPECT_TRUE(tab_bounds.Contains(contents_bounds)); | |
433 | 408 |
434 // Hit tests in the occluded region of the tab. | 409 // Hit tests in the occluded region of the tab. |
435 EXPECT_FALSE(most_right_tab->HitTestRect(gfx::Rect(20, 15, 1, 1))); | 410 EXPECT_FALSE(most_right_tab->HitTestRect(gfx::Rect(20, 15, 1, 1))); |
436 EXPECT_FALSE(most_right_tab->HitTestRect(gfx::Rect(20, 15, 5, 6))); | 411 EXPECT_FALSE(most_right_tab->HitTestRect(gfx::Rect(20, 15, 5, 6))); |
437 | 412 |
438 // Hit tests in the non-occluded region of the tab. | 413 // Hit tests in the non-occluded region of the tab. |
439 EXPECT_TRUE(most_right_tab->HitTestRect(gfx::Rect(85, 15, 1, 1))); | 414 EXPECT_TRUE(most_right_tab->HitTestRect(gfx::Rect(85, 15, 1, 1))); |
440 EXPECT_TRUE(most_right_tab->HitTestRect(gfx::Rect(85, 15, 2, 2))); | 415 EXPECT_TRUE(most_right_tab->HitTestRect(gfx::Rect(85, 15, 2, 2))); |
441 | |
442 // Hit tests against the tab close button. Note that hit tests from either | |
443 // mouse or touch should both fail if they are strictly contained within | |
444 // the button's padding. | |
445 views::ImageButton* most_right_close = most_right_tab->close_button_; | |
446 EXPECT_FALSE(most_right_close->HitTestRect(gfx::Rect(1, 1, 1, 1))); | |
447 EXPECT_FALSE(most_right_close->HitTestRect(gfx::Rect(1, 1, 2, 2))); | |
448 EXPECT_TRUE(most_right_close->HitTestRect(gfx::Rect(10, 10, 1, 1))); | |
449 EXPECT_TRUE(most_right_close->HitTestRect(gfx::Rect(10, 10, 25, 35))); | |
450 EXPECT_TRUE(most_right_close->HitTestRect(gfx::Rect(-10, 10, 25, 35))); | |
451 } | 416 } |
452 | 417 |
453 // Creates a tab strip in stacked layout mode and verifies the correctness | 418 // Tests that the tab close buttons of non-active tabs are hidden when |
454 // of hit tests against the visible/occluded region of a partially-occluded | 419 // the tabstrip is in stacked tab mode. |
455 // tab close button. | 420 TEST_F(TabStripTest, TabCloseButtonVisibilityWhenStacked) { |
456 TEST_F(TabStripTest, ClippedTabCloseButton) { | 421 tab_strip_->SetBounds(0, 0, 300, 20); |
457 tab_strip_->SetBounds(0, 0, 220, 20); | |
458 | |
459 controller_->AddTab(0, false); | 422 controller_->AddTab(0, false); |
460 controller_->AddTab(1, true); | 423 controller_->AddTab(1, true); |
461 ASSERT_EQ(2, tab_strip_->tab_count()); | 424 controller_->AddTab(2, false); |
425 ASSERT_EQ(3, tab_strip_->tab_count()); | |
462 | 426 |
463 Tab* left_tab = tab_strip_->tab_at(0); | 427 Tab* tab0 = tab_strip_->tab_at(0); |
464 left_tab->SetBoundsRect(gfx::Rect(gfx::Point(0, 0), gfx::Size(200, 20))); | 428 Tab* tab1 = tab_strip_->tab_at(1); |
429 ASSERT_TRUE(tab1->IsActive()); | |
430 Tab* tab2 = tab_strip_->tab_at(2); | |
465 | 431 |
466 Tab* active_tab = tab_strip_->tab_at(1); | 432 // Ensure that all tab close buttons are visible. |
467 active_tab->SetBoundsRect(gfx::Rect(gfx::Point(180, 0), gfx::Size(200, 20))); | 433 EXPECT_TRUE(tab0->showing_close_button_); |
468 ASSERT_TRUE(active_tab->IsActive()); | 434 EXPECT_TRUE(tab1->showing_close_button_); |
435 EXPECT_TRUE(tab2->showing_close_button_); | |
469 | 436 |
470 // Switch to stacked layout mode and force a layout to ensure tabs stack. | 437 // The tabs are not yet narrow enough to require stacking, |
438 // so all close buttons should remain visible. | |
471 tab_strip_->SetStackedLayout(true); | 439 tab_strip_->SetStackedLayout(true); |
472 tab_strip_->DoLayout(); | 440 EXPECT_TRUE(tab0->showing_close_button_); |
441 EXPECT_TRUE(tab1->showing_close_button_); | |
442 EXPECT_TRUE(tab2->showing_close_button_); | |
473 | 443 |
444 // Adding a new tab should trigger a relayout; with four tabs in the | |
445 // tabstrip and stacked layout set to true, the close buttons of | |
446 // the inactive tabs should be hidden. | |
447 controller_->AddTab(3, false); | |
448 Tab* tab3 = tab_strip_->tab_at(3); | |
sky
2015/03/11 18:20:14
I think you want an assertion here that you're in
tdanderson
2015/03/11 19:30:13
Done.
| |
449 EXPECT_FALSE(tab0->showing_close_button_); | |
450 EXPECT_TRUE(tab1->showing_close_button_); | |
451 EXPECT_FALSE(tab2->showing_close_button_); | |
452 EXPECT_FALSE(tab3->showing_close_button_); | |
tdanderson
2015/03/11 18:01:39
Everything works fine up to here. AddTab() trigger
| |
474 | 453 |
475 // Tests involving |left_tab|, which has part of its bounds and its tab | 454 /* |
476 // close button partially occluded by |active_tab|. | 455 // Switch tabs. |
456 tab_strip_->SelectTab(tab2); | |
tdanderson
2015/03/11 18:01:38
Lines 458 and 459 fail. SelectTab() does not trigg
sky
2015/03/11 18:20:14
I suspect you just send what the problem is. You'r
tdanderson
2015/03/11 19:30:13
Done.
| |
457 EXPECT_FALSE(tab0->showing_close_button_); | |
458 EXPECT_FALSE(tab1->showing_close_button_); | |
459 EXPECT_TRUE(tab2->showing_close_button_); | |
460 EXPECT_FALSE(tab3->showing_close_button_); | |
461 */ | |
477 | 462 |
478 // Bounds of the tab's hit test mask. | 463 /* |
479 gfx::Rect tab_bounds = GetTabHitTestMask(left_tab); | 464 // Close a tab. Three tabs remain, so touch layout should not be |
tdanderson
2015/03/11 18:01:38
Lines 467-469 also fail. CloseTab() does not trigg
| |
480 EXPECT_EQ(gfx::Rect(6, 2, 91, 27).ToString(), tab_bounds.ToString()); | 465 // active and the close buttons should be visible for all tabs. |
466 tab_strip_->CloseTab(tab1, CLOSE_TAB_FROM_TOUCH); | |
467 EXPECT_TRUE(tab0->showing_close_button_); | |
468 EXPECT_TRUE(tab2->showing_close_button_); | |
469 EXPECT_TRUE(tab3->showing_close_button_); | |
470 */ | |
481 | 471 |
482 // Bounds of the tab close button (without padding) in the tab's | 472 // When exiting stacked layout mode all tab close buttons should |
483 // coordinate space. | 473 // become visible again. Setting the tab strip size triggers |
484 gfx::Rect contents_bounds = GetTabCloseHitTestMask(left_tab, false); | 474 // a relayout. |
485 // TODO(tdanderson): Uncomment this line once crbug.com/311609 is resolved. | 475 /* |
486 //EXPECT_EQ(gfx::Rect(84, 8, 18, 18).ToString(), contents_bounds.ToString()); | 476 tab_strip_->SetStackedLayout(false); |
487 | 477 tab_strip_->SetBounds(0, 0, 300, 20); |
488 // Verify that the tab close button is only partially occluded. | 478 EXPECT_TRUE(tab0->showing_close_button_); |
489 EXPECT_FALSE(tab_bounds.Contains(contents_bounds)); | 479 EXPECT_TRUE(tab1->showing_close_button_); |
490 EXPECT_TRUE(tab_bounds.Intersects(contents_bounds)); | 480 EXPECT_TRUE(tab2->showing_close_button_); |
491 | 481 */ |
492 views::ImageButton* left_close = left_tab->close_button_; | |
493 | |
494 // Hit tests from mouse should return true if and only if the location | |
495 // is within a visible region. | |
496 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(2, 15, 1, 1))); | |
497 EXPECT_TRUE(left_close->HitTestRect(gfx::Rect(3, 15, 1, 1))); | |
498 EXPECT_TRUE(left_close->HitTestRect(gfx::Rect(10, 10, 1, 1))); | |
499 EXPECT_TRUE(left_close->HitTestRect(gfx::Rect(15, 12, 1, 1))); | |
500 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(16, 10, 1, 1))); | |
501 | |
502 // All hit tests from touch should return false because the button is | |
503 // not fully visible. | |
504 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(2, 15, 2, 2))); | |
505 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(3, 15, 25, 25))); | |
506 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(10, 10, 4, 5))); | |
507 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(15, 12, 2, 2))); | |
508 EXPECT_FALSE(left_close->HitTestRect(gfx::Rect(16, 10, 20, 20))); | |
509 } | 482 } |
510 | 483 |
511 TEST_F(TabStripTest, GetEventHandlerForOverlappingArea) { | 484 TEST_F(TabStripTest, GetEventHandlerForOverlappingArea) { |
512 tab_strip_->SetBounds(0, 0, 1000, 20); | 485 tab_strip_->SetBounds(0, 0, 1000, 20); |
513 | 486 |
514 controller_->AddTab(0, false); | 487 controller_->AddTab(0, false); |
515 controller_->AddTab(1, true); | 488 controller_->AddTab(1, true); |
516 controller_->AddTab(2, false); | 489 controller_->AddTab(2, false); |
517 controller_->AddTab(3, false); | 490 controller_->AddTab(3, false); |
518 ASSERT_EQ(4, tab_strip_->tab_count()); | 491 ASSERT_EQ(4, tab_strip_->tab_count()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
631 ASSERT_TRUE(IsPointInTab(most_right_tab, unactive_overlap)); | 604 ASSERT_TRUE(IsPointInTab(most_right_tab, unactive_overlap)); |
632 | 605 |
633 EXPECT_EQ( | 606 EXPECT_EQ( |
634 right_tab, | 607 right_tab, |
635 FindTabView(tab_strip_->GetTooltipHandlerForPoint(unactive_overlap))); | 608 FindTabView(tab_strip_->GetTooltipHandlerForPoint(unactive_overlap))); |
636 | 609 |
637 // Confirm that tab strip doe not return tooltip handler for points that | 610 // Confirm that tab strip doe not return tooltip handler for points that |
638 // don't hit it. | 611 // don't hit it. |
639 EXPECT_FALSE(tab_strip_->GetTooltipHandlerForPoint(gfx::Point(-1, 2))); | 612 EXPECT_FALSE(tab_strip_->GetTooltipHandlerForPoint(gfx::Point(-1, 2))); |
640 } | 613 } |
OLD | NEW |