Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: chrome/browser/sessions/session_restore_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <vector> 5 #include <vector>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/memory_pressure_listener.h" 10 #include "base/memory/memory_pressure_listener.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "content/public/browser/navigation_controller.h" 43 #include "content/public/browser/navigation_controller.h"
44 #include "content/public/browser/navigation_entry.h" 44 #include "content/public/browser/navigation_entry.h"
45 #include "content/public/browser/notification_service.h" 45 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/notification_types.h" 46 #include "content/public/browser/notification_types.h"
47 #include "content/public/browser/render_process_host.h" 47 #include "content/public/browser/render_process_host.h"
48 #include "content/public/browser/render_view_host.h" 48 #include "content/public/browser/render_view_host.h"
49 #include "content/public/browser/web_contents.h" 49 #include "content/public/browser/web_contents.h"
50 #include "content/public/common/bindings_policy.h" 50 #include "content/public/common/bindings_policy.h"
51 #include "content/public/test/browser_test_utils.h" 51 #include "content/public/test/browser_test_utils.h"
52 #include "content/public/test/test_navigation_observer.h" 52 #include "content/public/test/test_navigation_observer.h"
53 #include "net/test/embedded_test_server/embedded_test_server.h"
53 #include "sync/protocol/session_specifics.pb.h" 54 #include "sync/protocol/session_specifics.pb.h"
54 #include "ui/base/page_transition_types.h" 55 #include "ui/base/page_transition_types.h"
55 56
56 using sessions::SerializedNavigationEntry; 57 using sessions::SerializedNavigationEntry;
57 using sessions::SerializedNavigationEntryTestHelper; 58 using sessions::SerializedNavigationEntryTestHelper;
58 59
59 #if defined(OS_MACOSX) 60 #if defined(OS_MACOSX)
60 #include "base/mac/scoped_nsautorelease_pool.h" 61 #include "base/mac/scoped_nsautorelease_pool.h"
61 #endif 62 #endif
62 63
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 ASSERT_EQ(url1_, 959 ASSERT_EQ(url1_,
959 new_browser->tab_strip_model()->GetActiveWebContents()->GetURL()); 960 new_browser->tab_strip_model()->GetActiveWebContents()->GetURL());
960 } 961 }
961 962
962 // Tests that the SiteInstances used for entries in a restored tab's history 963 // Tests that the SiteInstances used for entries in a restored tab's history
963 // are given appropriate max page IDs, so that going back to a restored 964 // are given appropriate max page IDs, so that going back to a restored
964 // cross-site page and then forward again works. (Bug 1204135) 965 // cross-site page and then forward again works. (Bug 1204135)
965 // This test fails. See http://crbug.com/237497. 966 // This test fails. See http://crbug.com/237497.
966 IN_PROC_BROWSER_TEST_F(SessionRestoreTest, 967 IN_PROC_BROWSER_TEST_F(SessionRestoreTest,
967 DISABLED_RestoresCrossSiteForwardAndBackwardNavs) { 968 DISABLED_RestoresCrossSiteForwardAndBackwardNavs) {
968 ASSERT_TRUE(test_server()->Start()); 969 ASSERT_TRUE(embedded_test_server()->Start());
969 970
970 GURL cross_site_url(test_server()->GetURL("files/title2.html")); 971 GURL cross_site_url(embedded_test_server()->GetURL("/title2.html"));
971 972
972 // Visit URLs on different sites. 973 // Visit URLs on different sites.
973 ui_test_utils::NavigateToURL(browser(), url1_); 974 ui_test_utils::NavigateToURL(browser(), url1_);
974 ui_test_utils::NavigateToURL(browser(), cross_site_url); 975 ui_test_utils::NavigateToURL(browser(), cross_site_url);
975 ui_test_utils::NavigateToURL(browser(), url2_); 976 ui_test_utils::NavigateToURL(browser(), url2_);
976 977
977 GoBack(browser()); 978 GoBack(browser());
978 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); 979 Browser* new_browser = QuitBrowserAndRestore(browser(), 1);
979 ASSERT_EQ(1u, active_browser_list_->size()); 980 ASSERT_EQ(1u, active_browser_list_->size());
980 ASSERT_EQ(1, new_browser->tab_strip_model()->count()); 981 ASSERT_EQ(1, new_browser->tab_strip_model()->count());
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 // automatically at the start of the test. 1526 // automatically at the start of the test.
1526 for (size_t i = 1; i < web_contents().size(); i++) { 1527 for (size_t i = 1; i < web_contents().size(); i++) {
1527 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]); 1528 GURL expected_url = GURL(kUrls[activation_order[kExpectedNumTabs - i]]);
1528 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL()); 1529 ASSERT_EQ(expected_url, web_contents()[i]->GetLastCommittedURL());
1529 if (i > 0) { 1530 if (i > 0) {
1530 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(), 1531 ASSERT_GT(web_contents()[i - 1]->GetLastActiveTime(),
1531 web_contents()[i]->GetLastActiveTime()); 1532 web_contents()[i]->GetLastActiveTime());
1532 } 1533 }
1533 } 1534 }
1534 } 1535 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698