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

Side by Side Diff: chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc

Issue 1814002: Remove deprecated things from net test suite: (Closed)
Patch Set: Created 10 years, 7 months 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 #include "chrome/browser/download/download_manager.h" 6 #include "chrome/browser/download/download_manager.h"
7 #include "chrome/browser/profile.h" 7 #include "chrome/browser/profile.h"
8 #include "chrome/browser/renderer_host/site_instance.h" 8 #include "chrome/browser/renderer_host/site_instance.h"
9 #include "chrome/browser/tab_contents/tab_contents.h" 9 #include "chrome/browser/tab_contents/tab_contents.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 20 matching lines...) Expand all
31 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, 31 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
32 SwapProcessWithRelNoreferrerAndTargetBlank) { 32 SwapProcessWithRelNoreferrerAndTargetBlank) {
33 // Start two servers with different sites. 33 // Start two servers with different sites.
34 const wchar_t kDocRoot[] = L"chrome/test/data"; 34 const wchar_t kDocRoot[] = L"chrome/test/data";
35 scoped_refptr<HTTPTestServer> http_server = 35 scoped_refptr<HTTPTestServer> http_server =
36 HTTPTestServer::CreateServer(kDocRoot, NULL); 36 HTTPTestServer::CreateServer(kDocRoot, NULL);
37 scoped_refptr<HTTPSTestServer> https_server = 37 scoped_refptr<HTTPSTestServer> https_server =
38 HTTPSTestServer::CreateGoodServer(kDocRoot); 38 HTTPSTestServer::CreateGoodServer(kDocRoot);
39 39
40 // Load a page with links that open in a new window. 40 // Load a page with links that open in a new window.
41 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW( 41 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage(
42 L"files/click-noreferrer-links.html")); 42 "files/click-noreferrer-links.html"));
43 43
44 // Get the original SiteInstance for later comparison. 44 // Get the original SiteInstance for later comparison.
45 scoped_refptr<SiteInstance> orig_site_instance( 45 scoped_refptr<SiteInstance> orig_site_instance(
46 browser()->GetSelectedTabContents()->GetSiteInstance()); 46 browser()->GetSelectedTabContents()->GetSiteInstance());
47 EXPECT_TRUE(orig_site_instance != NULL); 47 EXPECT_TRUE(orig_site_instance != NULL);
48 48
49 // Test clicking a rel=noreferrer + target=blank link. 49 // Test clicking a rel=noreferrer + target=blank link.
50 bool success = false; 50 bool success = false;
51 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 51 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
52 browser()->GetSelectedTabContents()->render_view_host(), L"", 52 browser()->GetSelectedTabContents()->render_view_host(), L"",
(...skipping 21 matching lines...) Expand all
74 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, 74 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
75 DontSwapProcessWithOnlyTargetBlank) { 75 DontSwapProcessWithOnlyTargetBlank) {
76 // Start two servers with different sites. 76 // Start two servers with different sites.
77 const wchar_t kDocRoot[] = L"chrome/test/data"; 77 const wchar_t kDocRoot[] = L"chrome/test/data";
78 scoped_refptr<HTTPTestServer> http_server = 78 scoped_refptr<HTTPTestServer> http_server =
79 HTTPTestServer::CreateServer(kDocRoot, NULL); 79 HTTPTestServer::CreateServer(kDocRoot, NULL);
80 scoped_refptr<HTTPSTestServer> https_server = 80 scoped_refptr<HTTPSTestServer> https_server =
81 HTTPSTestServer::CreateGoodServer(kDocRoot); 81 HTTPSTestServer::CreateGoodServer(kDocRoot);
82 82
83 // Load a page with links that open in a new window. 83 // Load a page with links that open in a new window.
84 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW( 84 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage(
85 L"files/click-noreferrer-links.html")); 85 "files/click-noreferrer-links.html"));
86 86
87 // Get the original SiteInstance for later comparison. 87 // Get the original SiteInstance for later comparison.
88 scoped_refptr<SiteInstance> orig_site_instance( 88 scoped_refptr<SiteInstance> orig_site_instance(
89 browser()->GetSelectedTabContents()->GetSiteInstance()); 89 browser()->GetSelectedTabContents()->GetSiteInstance());
90 EXPECT_TRUE(orig_site_instance != NULL); 90 EXPECT_TRUE(orig_site_instance != NULL);
91 91
92 // Test clicking a target=blank link. 92 // Test clicking a target=blank link.
93 bool success = false; 93 bool success = false;
94 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 94 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
95 browser()->GetSelectedTabContents()->render_view_host(), L"", 95 browser()->GetSelectedTabContents()->render_view_host(), L"",
(...skipping 21 matching lines...) Expand all
117 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, 117 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
118 DontSwapProcessWithOnlyRelNoreferrer) { 118 DontSwapProcessWithOnlyRelNoreferrer) {
119 // Start two servers with different sites. 119 // Start two servers with different sites.
120 const wchar_t kDocRoot[] = L"chrome/test/data"; 120 const wchar_t kDocRoot[] = L"chrome/test/data";
121 scoped_refptr<HTTPTestServer> http_server = 121 scoped_refptr<HTTPTestServer> http_server =
122 HTTPTestServer::CreateServer(kDocRoot, NULL); 122 HTTPTestServer::CreateServer(kDocRoot, NULL);
123 scoped_refptr<HTTPSTestServer> https_server = 123 scoped_refptr<HTTPSTestServer> https_server =
124 HTTPSTestServer::CreateGoodServer(kDocRoot); 124 HTTPSTestServer::CreateGoodServer(kDocRoot);
125 125
126 // Load a page with links that open in a new window. 126 // Load a page with links that open in a new window.
127 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW( 127 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage(
128 L"files/click-noreferrer-links.html")); 128 "files/click-noreferrer-links.html"));
129 129
130 // Get the original SiteInstance for later comparison. 130 // Get the original SiteInstance for later comparison.
131 scoped_refptr<SiteInstance> orig_site_instance( 131 scoped_refptr<SiteInstance> orig_site_instance(
132 browser()->GetSelectedTabContents()->GetSiteInstance()); 132 browser()->GetSelectedTabContents()->GetSiteInstance());
133 EXPECT_TRUE(orig_site_instance != NULL); 133 EXPECT_TRUE(orig_site_instance != NULL);
134 134
135 // Test clicking a rel=noreferrer link. 135 // Test clicking a rel=noreferrer link.
136 bool success = false; 136 bool success = false;
137 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 137 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
138 browser()->GetSelectedTabContents()->render_view_host(), L"", 138 browser()->GetSelectedTabContents()->render_view_host(), L"",
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 &result)); 232 &result));
233 EXPECT_TRUE(result); 233 EXPECT_TRUE(result);
234 ui_test_utils::NavigateToURL(browser(), zip_url); 234 ui_test_utils::NavigateToURL(browser(), zip_url);
235 235
236 ui_test_utils::WaitForDownloadCount( 236 ui_test_utils::WaitForDownloadCount(
237 browser()->profile()->GetDownloadManager(), 1); 237 browser()->profile()->GetDownloadManager(), 1);
238 238
239 browser()->CloseWindow(); 239 browser()->CloseWindow();
240 BrowserClosedObserver wait_for_close(browser()); 240 BrowserClosedObserver wait_for_close(browser());
241 } 241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698