OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_notification_types.h" | 5 #include "chrome/browser/chrome_notification_types.h" |
6 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 6 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_live_tab_context.h" | 10 #include "chrome/browser/ui/browser_live_tab_context.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 BrowserList* active_browser_list = BrowserList::GetInstance(); | 75 BrowserList* active_browser_list = BrowserList::GetInstance(); |
76 EXPECT_EQ(2u, active_browser_list->size()); | 76 EXPECT_EQ(2u, active_browser_list->size()); |
77 | 77 |
78 // Close the first browser. | 78 // Close the first browser. |
79 CloseBrowser(browser()); | 79 CloseBrowser(browser()); |
80 EXPECT_EQ(1u, active_browser_list->size()); | 80 EXPECT_EQ(1u, active_browser_list->size()); |
81 | 81 |
82 // Restore tabs using the browser's recent tabs menu. | 82 // Restore tabs using the browser's recent tabs menu. |
83 content::DOMMessageQueue queue; | 83 content::DOMMessageQueue queue; |
84 Browser* browser = active_browser_list->get(0); | 84 Browser* browser = active_browser_list->get(0); |
85 RecentTabsSubMenuModel menu(NULL, browser, NULL); | 85 RecentTabsSubMenuModel menu(nullptr, browser); |
86 menu.ExecuteCommand( | 86 menu.ExecuteCommand( |
87 RecentTabsSubMenuModel::GetFirstRecentTabsCommandId(), 0); | 87 RecentTabsSubMenuModel::GetFirstRecentTabsCommandId(), 0); |
88 AwaitTabsReady(&queue, 2); | 88 AwaitTabsReady(&queue, 2); |
89 | 89 |
90 // There should be 3 restored tabs in the new browser. | 90 // There should be 3 restored tabs in the new browser. |
91 EXPECT_EQ(2u, active_browser_list->size()); | 91 EXPECT_EQ(2u, active_browser_list->size()); |
92 browser = active_browser_list->get(1); | 92 browser = active_browser_list->get(1); |
93 EXPECT_EQ(3, browser->tab_strip_model()->count()); | 93 EXPECT_EQ(3, browser->tab_strip_model()->count()); |
94 // For the two test tabs we've just received "READY" DOM message. | 94 // For the two test tabs we've just received "READY" DOM message. |
95 // But there won't be such message from the "about:blank" tab. | 95 // But there won't be such message from the "about:blank" tab. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 content::NOTIFICATION_LOAD_STOP, | 163 content::NOTIFICATION_LOAD_STOP, |
164 content::Source<content::NavigationController>( | 164 content::Source<content::NavigationController>( |
165 &about_blank_contents->GetController())); | 165 &about_blank_contents->GetController())); |
166 load_stop_observer.Wait(); | 166 load_stop_observer.Wait(); |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 // The middle tab only should have visible disposition. | 170 // The middle tab only should have visible disposition. |
171 CheckVisbility(browser->tab_strip_model(), 1); | 171 CheckVisbility(browser->tab_strip_model(), 1); |
172 } | 172 } |
OLD | NEW |