| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/browser_tabstrip.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 Browser* browser2 = | 47 Browser* browser2 = |
| 48 new Browser(Browser::CreateParams(browser()->profile(), | 48 new Browser(Browser::CreateParams(browser()->profile(), |
| 49 browser()->host_desktop_type())); | 49 browser()->host_desktop_type())); |
| 50 chrome::AddTabAt(browser2, GURL(), -1, true); | 50 chrome::AddTabAt(browser2, GURL(), -1, true); |
| 51 chrome::AddTabAt(browser2, GURL(), -1, true); | 51 chrome::AddTabAt(browser2, GURL(), -1, true); |
| 52 TestWebContentsObserver observer( | 52 TestWebContentsObserver observer( |
| 53 browser2->tab_strip_model()->GetWebContentsAt(0), | 53 browser2->tab_strip_model()->GetWebContentsAt(0), |
| 54 browser2->tab_strip_model()->GetWebContentsAt(1)); | 54 browser2->tab_strip_model()->GetWebContentsAt(1)); |
| 55 BrowserView::GetBrowserViewForBrowser(browser2)->GetWidget()->CloseNow(); | 55 BrowserView::GetBrowserViewForBrowser(browser2)->GetWidget()->CloseNow(); |
| 56 } | 56 } |
| 57 |
| 58 // Same as CloseWithTabs, but activates the first tab, which is the first tab |
| 59 // BrowserView will destroy. |
| 60 IN_PROC_BROWSER_TEST_F(BrowserViewTest, CloseWithTabsStartWithActive) { |
| 61 Browser* browser2 = |
| 62 new Browser(Browser::CreateParams(browser()->profile(), |
| 63 browser()->host_desktop_type())); |
| 64 chrome::AddTabAt(browser2, GURL(), -1, true); |
| 65 chrome::AddTabAt(browser2, GURL(), -1, true); |
| 66 browser2->tab_strip_model()->ActivateTabAt(0, true); |
| 67 TestWebContentsObserver observer( |
| 68 browser2->tab_strip_model()->GetWebContentsAt(0), |
| 69 browser2->tab_strip_model()->GetWebContentsAt(1)); |
| 70 BrowserView::GetBrowserViewForBrowser(browser2)->GetWidget()->CloseNow(); |
| 71 } |
| OLD | NEW |