| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/defaults.h" | 5 #include "chrome/browser/defaults.h" |
| 6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/browser_window.h" | 7 #include "chrome/browser/browser_window.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/test/in_process_browser_test.h" | 9 #include "chrome/test/in_process_browser_test.h" |
| 10 #include "chrome/test/ui_test_utils.h" | 10 #include "chrome/test/ui_test_utils.h" |
| 11 | 11 |
| 12 typedef InProcessBrowserTest SessionRestoreTest; | 12 typedef InProcessBrowserTest SessionRestoreTest; |
| 13 | 13 |
| 14 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
| 15 // http://crbug.com/39476 |
| 16 #define RestoreOnNewWindowWithNoTabbedBrowsers \ |
| 17 DISABLED_RestoreOnNewWindowWithNoTabbedBrowsers |
| 18 #endif |
| 19 |
| 14 // Makes sure when session restore is triggered in the same process we don't end | 20 // Makes sure when session restore is triggered in the same process we don't end |
| 15 // up with an extra tab. | 21 // up with an extra tab. |
| 16 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, | 22 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, |
| 17 RestoreOnNewWindowWithNoTabbedBrowsers) { | 23 RestoreOnNewWindowWithNoTabbedBrowsers) { |
| 18 if (browser_defaults::kRestorePopups) | 24 if (browser_defaults::kRestorePopups) |
| 19 return; | 25 return; |
| 20 | 26 |
| 21 GURL url(ui_test_utils::GetTestUrl(L".", L"title1.html")); | 27 GURL url(ui_test_utils::GetTestUrl(L".", L"title1.html")); |
| 22 ui_test_utils::NavigateToURL(browser(), url); | 28 ui_test_utils::NavigateToURL(browser(), url); |
| 23 | 29 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 Browser* new_browser = ui_test_utils::WaitForNewBrowser(); | 46 Browser* new_browser = ui_test_utils::WaitForNewBrowser(); |
| 41 | 47 |
| 42 ASSERT_TRUE(new_browser != NULL); | 48 ASSERT_TRUE(new_browser != NULL); |
| 43 | 49 |
| 44 // The browser should only have one tab. | 50 // The browser should only have one tab. |
| 45 ASSERT_EQ(1, new_browser->tab_count()); | 51 ASSERT_EQ(1, new_browser->tab_count()); |
| 46 | 52 |
| 47 // And the first url should be url. | 53 // And the first url should be url. |
| 48 EXPECT_EQ(url, new_browser->GetTabContentsAt(0)->GetURL()); | 54 EXPECT_EQ(url, new_browser->GetTabContentsAt(0)->GetURL()); |
| 49 } | 55 } |
| OLD | NEW |