| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #endif | 10 #endif |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 EXPECT_EQ(url1_, GetActiveTabURL(1)); | 449 EXPECT_EQ(url1_, GetActiveTabURL(1)); |
| 450 } | 450 } |
| 451 | 451 |
| 452 // Tests that a duplicate history entry is not created when we restore a page | 452 // Tests that a duplicate history entry is not created when we restore a page |
| 453 // to an existing SiteInstance. (Bug 1230446) | 453 // to an existing SiteInstance. (Bug 1230446) |
| 454 TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { | 454 TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { |
| 455 const wchar_t kDocRoot[] = L"chrome/test/data"; | 455 const wchar_t kDocRoot[] = L"chrome/test/data"; |
| 456 scoped_refptr<HTTPTestServer> server = | 456 scoped_refptr<HTTPTestServer> server = |
| 457 HTTPTestServer::CreateServer(kDocRoot, NULL); | 457 HTTPTestServer::CreateServer(kDocRoot, NULL); |
| 458 ASSERT_TRUE(NULL != server.get()); | 458 ASSERT_TRUE(NULL != server.get()); |
| 459 GURL http_url1(server->TestServerPageW(L"files/title1.html")); | 459 GURL http_url1(server->TestServerPage("files/title1.html")); |
| 460 GURL http_url2(server->TestServerPageW(L"files/title2.html")); | 460 GURL http_url2(server->TestServerPage("files/title2.html")); |
| 461 | 461 |
| 462 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 462 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 463 ASSERT_TRUE(browser_proxy.get()); | 463 ASSERT_TRUE(browser_proxy.get()); |
| 464 int tab_count; | 464 int tab_count; |
| 465 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 465 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
| 466 | 466 |
| 467 // Add a tab | 467 // Add a tab |
| 468 ASSERT_TRUE(browser_proxy->AppendTab(http_url1)); | 468 ASSERT_TRUE(browser_proxy->AppendTab(http_url1)); |
| 469 int new_tab_count; | 469 int new_tab_count; |
| 470 ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count)); | 470 ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 496 } | 496 } |
| 497 | 497 |
| 498 // Tests that the SiteInstances used for entries in a restored tab's history | 498 // Tests that the SiteInstances used for entries in a restored tab's history |
| 499 // are given appropriate max page IDs, even if the renderer for the entry | 499 // are given appropriate max page IDs, even if the renderer for the entry |
| 500 // already exists. (Bug 1204135) | 500 // already exists. (Bug 1204135) |
| 501 TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) { | 501 TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) { |
| 502 const wchar_t kDocRoot[] = L"chrome/test/data"; | 502 const wchar_t kDocRoot[] = L"chrome/test/data"; |
| 503 scoped_refptr<HTTPTestServer> server = | 503 scoped_refptr<HTTPTestServer> server = |
| 504 HTTPTestServer::CreateServer(kDocRoot, NULL); | 504 HTTPTestServer::CreateServer(kDocRoot, NULL); |
| 505 ASSERT_TRUE(NULL != server.get()); | 505 ASSERT_TRUE(NULL != server.get()); |
| 506 GURL http_url1(server->TestServerPageW(L"files/title1.html")); | 506 GURL http_url1(server->TestServerPage("files/title1.html")); |
| 507 GURL http_url2(server->TestServerPageW(L"files/title2.html")); | 507 GURL http_url2(server->TestServerPage("files/title2.html")); |
| 508 | 508 |
| 509 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 509 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 510 ASSERT_TRUE(browser_proxy.get()); | 510 ASSERT_TRUE(browser_proxy.get()); |
| 511 int tab_count; | 511 int tab_count; |
| 512 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 512 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
| 513 | 513 |
| 514 // Add a tab | 514 // Add a tab |
| 515 ASSERT_TRUE(browser_proxy->AppendTab(http_url1)); | 515 ASSERT_TRUE(browser_proxy->AppendTab(http_url1)); |
| 516 int new_tab_count; | 516 int new_tab_count; |
| 517 ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count)); | 517 ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count)); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 GURL url; | 603 GURL url; |
| 604 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 604 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
| 605 EXPECT_TRUE(url == url1_); | 605 EXPECT_TRUE(url == url1_); |
| 606 | 606 |
| 607 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); | 607 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); |
| 608 ASSERT_TRUE(restored_tab_proxy.get()); | 608 ASSERT_TRUE(restored_tab_proxy.get()); |
| 609 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 609 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
| 610 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 610 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
| 611 EXPECT_TRUE(url == url2_); | 611 EXPECT_TRUE(url == url2_); |
| 612 } | 612 } |
| OLD | NEW |