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

Side by Side Diff: content/renderer/browser_render_view_browsertest.cc

Issue 1411073005: Migrating tests to use EmbeddedTestServer (/content) (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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Browser tests targeted at the RenderView that run in browser context. 5 // Browser tests targeted at the RenderView that run in browser context.
6 // Note that these tests rely on single-process mode, and hence may be 6 // Note that these tests rely on single-process mode, and hence may be
7 // disabled in some configurations (check gyp files). 7 // disabled in some configurations (check gyp files).
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 TestShellContentRendererClient* renderer_client, 187 TestShellContentRendererClient* renderer_client,
188 bool* result, int* error_code, bool* stale_cache_entry_present) { 188 bool* result, int* error_code, bool* stale_cache_entry_present) {
189 *result = renderer_client->GetLatestError( 189 *result = renderer_client->GetLatestError(
190 error_code, stale_cache_entry_present); 190 error_code, stale_cache_entry_present);
191 } 191 }
192 192
193 TestShellContentRendererClient* renderer_client_; 193 TestShellContentRendererClient* renderer_client_;
194 }; 194 };
195 195
196 IN_PROC_BROWSER_TEST_F(RenderViewBrowserTest, ConfirmCacheInformationPlumbed) { 196 IN_PROC_BROWSER_TEST_F(RenderViewBrowserTest, ConfirmCacheInformationPlumbed) {
197 ASSERT_TRUE(test_server()->Start()); 197 ASSERT_TRUE(embedded_test_server()->Start());
198 198
199 // Load URL with "nocache" set, to create stale cache. 199 // Load URL with "nocache" set, to create stale cache.
200 GURL test_url(test_server()->GetURL("files/nocache.html")); 200 GURL test_url(embedded_test_server()->GetURL("/nocache.html"));
201 NavigateToURLAndWaitForTitle(test_url, "Nocache Test Page", 1); 201 NavigateToURLAndWaitForTitle(test_url, "Nocache Test Page", 1);
202 202
203 // Reload same URL after forcing an error from the the network layer; 203 // Reload same URL after forcing an error from the the network layer;
204 // confirm that the error page is told the cached copy exists. 204 // confirm that the error page is told the cached copy exists.
205 int renderer_id = 205 int renderer_id =
206 shell()->web_contents()->GetMainFrame()->GetProcess()->GetID(); 206 shell()->web_contents()->GetMainFrame()->GetProcess()->GetID();
207 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter = 207 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter =
208 ShellContentBrowserClient::Get()->browser_context()-> 208 ShellContentBrowserClient::Get()->browser_context()->
209 GetRequestContextForRenderProcess(renderer_id); 209 GetRequestContextForRenderProcess(renderer_id);
210 BrowserThread::PostTask( 210 BrowserThread::PostTask(
(...skipping 22 matching lines...) Expand all
233 233
234 error_code = net::OK; 234 error_code = net::OK;
235 stale_cache_entry_present = true; 235 stale_cache_entry_present = true;
236 ASSERT_TRUE(GetLatestErrorFromRendererClient( 236 ASSERT_TRUE(GetLatestErrorFromRendererClient(
237 &error_code, &stale_cache_entry_present)); 237 &error_code, &stale_cache_entry_present));
238 EXPECT_EQ(net::ERR_FAILED, error_code); 238 EXPECT_EQ(net::ERR_FAILED, error_code);
239 EXPECT_FALSE(stale_cache_entry_present); 239 EXPECT_FALSE(stale_cache_entry_present);
240 } 240 }
241 241
242 } // namespace content 242 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/renderer/resource_fetcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698