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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // Tests that screenshot is taken correctly when navigation causes a | 359 // Tests that screenshot is taken correctly when navigation causes a |
360 // RenderViewHost to be swapped out. | 360 // RenderViewHost to be swapped out. |
361 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, | 361 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, |
362 ScreenshotForSwappedOutRenderViews) { | 362 ScreenshotForSwappedOutRenderViews) { |
363 ASSERT_NO_FATAL_FAILURE( | 363 ASSERT_NO_FATAL_FAILURE( |
364 StartTestWithPage("files/overscroll_navigation.html")); | 364 StartTestWithPage("files/overscroll_navigation.html")); |
365 // Create a new server with a different site. | 365 // Create a new server with a different site. |
366 net::TestServer https_server( | 366 net::TestServer https_server( |
367 net::TestServer::TYPE_HTTPS, | 367 net::TestServer::TYPE_HTTPS, |
368 net::TestServer::kLocalhost, | 368 net::TestServer::kLocalhost, |
369 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 369 net::TestServer::GetSourceRelativePath( |
| 370 base::FilePath(FILE_PATH_LITERAL("content/test/data")))); |
370 ASSERT_TRUE(https_server.Start()); | 371 ASSERT_TRUE(https_server.Start()); |
371 | 372 |
372 WebContentsImpl* web_contents = | 373 WebContentsImpl* web_contents = |
373 static_cast<WebContentsImpl*>(shell()->web_contents()); | 374 static_cast<WebContentsImpl*>(shell()->web_contents()); |
374 | 375 |
375 struct { | 376 struct { |
376 GURL url; | 377 GURL url; |
377 int transition; | 378 int transition; |
378 } navigations[] = { | 379 } navigations[] = { |
379 { https_server.GetURL("files/title1.html"), | 380 { https_server.GetURL("files/title1.html"), |
(...skipping 24 matching lines...) Expand all Loading... |
404 web_contents->GetController().GetEntryAtOffset(-1)); | 405 web_contents->GetController().GetEntryAtOffset(-1)); |
405 EXPECT_TRUE(entry->screenshot().get()); | 406 EXPECT_TRUE(entry->screenshot().get()); |
406 | 407 |
407 entry = NavigationEntryImpl::FromNavigationEntry( | 408 entry = NavigationEntryImpl::FromNavigationEntry( |
408 web_contents->GetController().GetActiveEntry()); | 409 web_contents->GetController().GetActiveEntry()); |
409 EXPECT_FALSE(entry->screenshot().get()); | 410 EXPECT_FALSE(entry->screenshot().get()); |
410 } | 411 } |
411 } | 412 } |
412 | 413 |
413 } // namespace content | 414 } // namespace content |
OLD | NEW |