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

Side by Side Diff: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc

Issue 2562853002: [Sync] Fix flakiness from Sessions refactor (Closed)
Patch Set: Fix SetSyncId Created 4 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/toolbar/recent_tabs_sub_menu_model.h" 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 TestRecentTabsSubMenuModel model(NULL, browser(), GetOpenTabsDelegate()); 566 TestRecentTabsSubMenuModel model(NULL, browser(), GetOpenTabsDelegate());
567 int num_items = model.GetItemCount(); 567 int num_items = model.GetItemCount();
568 EXPECT_EQ(9, num_items); 568 EXPECT_EQ(9, num_items);
569 569
570 std::vector<base::string16> tab_titles = 570 std::vector<base::string16> tab_titles =
571 recent_tabs_builder.GetTabTitlesSortedByRecency(); 571 recent_tabs_builder.GetTabTitlesSortedByRecency();
572 for (int i = 0; i < 4; ++i) 572 for (int i = 0; i < 4; ++i)
573 EXPECT_EQ(tab_titles[i], model.GetLabelAt(i + 5)); 573 EXPECT_EQ(tab_titles[i], model.GetLabelAt(i + 5));
574 } 574 }
575 575
576 // Flaky, see crbug.com/671902. 576 TEST_F(RecentTabsSubMenuModelTest, MaxWidth) {
577 TEST_F(RecentTabsSubMenuModelTest, DISABLED_MaxWidth) {
578 // Create 1 session with 1 window and 1 tab. 577 // Create 1 session with 1 window and 1 tab.
579 RecentTabsBuilderTestHelper recent_tabs_builder; 578 RecentTabsBuilderTestHelper recent_tabs_builder;
580 recent_tabs_builder.AddSession(); 579 recent_tabs_builder.AddSession();
581 recent_tabs_builder.AddWindow(0); 580 recent_tabs_builder.AddWindow(0);
582 recent_tabs_builder.AddTab(0, 0); 581 recent_tabs_builder.AddTab(0, 0);
583 RegisterRecentTabs(&recent_tabs_builder); 582 RegisterRecentTabs(&recent_tabs_builder);
584 583
585 // Menu index Menu items 584 // Menu index Menu items
586 // ---------------------------------------------------------- 585 // ----------------------------------------------------------
587 // 0 History 586 // 0 History
(...skipping 20 matching lines...) Expand all
608 // 2 Recently closed heaer (disabled) 607 // 2 Recently closed heaer (disabled)
609 // 3 <separator> 608 // 3 <separator>
610 // 4 No tabs from other Devices 609 // 4 No tabs from other Devices
611 610
612 TestRecentTabsSubMenuModel model(NULL, browser(), NULL); 611 TestRecentTabsSubMenuModel model(NULL, browser(), NULL);
613 EXPECT_EQ(5, model.GetItemCount()); 612 EXPECT_EQ(5, model.GetItemCount());
614 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2)); 613 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(2));
615 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3)); 614 EXPECT_NE(-1, model.GetMaxWidthForItemAtIndex(3));
616 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4)); 615 EXPECT_EQ(-1, model.GetMaxWidthForItemAtIndex(4));
617 } 616 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698