| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // Close the tab. | 539 // Close the tab. |
| 540 CloseTab(1); | 540 CloseTab(1); |
| 541 | 541 |
| 542 // Restore the closed tab. | 542 // Restore the closed tab. |
| 543 ASSERT_NO_FATAL_FAILURE(RestoreTab(0, 1)); | 543 ASSERT_NO_FATAL_FAILURE(RestoreTab(0, 1)); |
| 544 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); | 544 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); |
| 545 EnsureTabFinishedRestoring(tab); | 545 EnsureTabFinishedRestoring(tab); |
| 546 | 546 |
| 547 // See if content is as expected. | 547 // See if content is as expected. |
| 548 EXPECT_GT( | 548 EXPECT_GT( |
| 549 ui_test_utils::FindInPage(tab, ASCIIToUTF16("webkit"), true, false, NULL, | 549 ui_test_utils::FindInPage(tab, base::ASCIIToUTF16("webkit"), true, false, |
| 550 NULL), | 550 NULL, NULL), |
| 551 0); | 551 0); |
| 552 } | 552 } |
| 553 | 553 |
| 554 // Restore tab with special URL in its navigation history, go back to that | 554 // Restore tab with special URL in its navigation history, go back to that |
| 555 // entry and see that it loads properly. See http://crbug.com/31905 | 555 // entry and see that it loads properly. See http://crbug.com/31905 |
| 556 IN_PROC_BROWSER_TEST_F(TabRestoreTest, RestoreTabWithSpecialURLOnBack) { | 556 IN_PROC_BROWSER_TEST_F(TabRestoreTest, RestoreTabWithSpecialURLOnBack) { |
| 557 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 557 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 558 | 558 |
| 559 const GURL http_url(embedded_test_server()->GetURL("/title1.html")); | 559 const GURL http_url(embedded_test_server()->GetURL("/title1.html")); |
| 560 | 560 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 571 | 571 |
| 572 // Restore the closed tab. | 572 // Restore the closed tab. |
| 573 ASSERT_NO_FATAL_FAILURE(RestoreTab(0, 1)); | 573 ASSERT_NO_FATAL_FAILURE(RestoreTab(0, 1)); |
| 574 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); | 574 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); |
| 575 EnsureTabFinishedRestoring(tab); | 575 EnsureTabFinishedRestoring(tab); |
| 576 ASSERT_EQ(http_url, tab->GetURL()); | 576 ASSERT_EQ(http_url, tab->GetURL()); |
| 577 | 577 |
| 578 // Go back, and see if content is as expected. | 578 // Go back, and see if content is as expected. |
| 579 GoBack(browser()); | 579 GoBack(browser()); |
| 580 EXPECT_GT( | 580 EXPECT_GT( |
| 581 ui_test_utils::FindInPage(tab, ASCIIToUTF16("webkit"), true, false, NULL, | 581 ui_test_utils::FindInPage(tab, base::ASCIIToUTF16("webkit"), true, false, |
| 582 NULL), | 582 NULL, NULL), |
| 583 0); | 583 0); |
| 584 } | 584 } |
| OLD | NEW |