Chromium Code Reviews| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 EXPECT_NE(old_host, web_contents->GetRenderViewHost()) | 464 EXPECT_NE(old_host, web_contents->GetRenderViewHost()) |
| 465 << navigations[i].url.spec(); | 465 << navigations[i].url.spec(); |
| 466 EXPECT_EQ(old_host, screenshot_manager()->screenshot_taken_for()); | 466 EXPECT_EQ(old_host, screenshot_manager()->screenshot_taken_for()); |
| 467 screenshot_manager()->Reset(); | 467 screenshot_manager()->Reset(); |
| 468 | 468 |
| 469 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 469 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
| 470 web_contents->GetController().GetEntryAtOffset(-1)); | 470 web_contents->GetController().GetEntryAtOffset(-1)); |
| 471 EXPECT_TRUE(entry->screenshot().get()); | 471 EXPECT_TRUE(entry->screenshot().get()); |
| 472 | 472 |
| 473 entry = NavigationEntryImpl::FromNavigationEntry( | 473 entry = NavigationEntryImpl::FromNavigationEntry( |
| 474 web_contents->GetController().GetActiveEntry()); | 474 web_contents->GetController().GetVisibleEntry()); |
|
Charlie Reis
2013/08/16 22:10:14
Perhaps we should encourage GetLastCommittedEntry
nasko
2013/09/12 17:56:31
Done.
| |
| 475 EXPECT_FALSE(entry->screenshot().get()); | 475 EXPECT_FALSE(entry->screenshot().get()); |
| 476 } | 476 } |
| 477 | 477 |
| 478 // Increase the minimum interval between taking screenshots. | 478 // Increase the minimum interval between taking screenshots. |
| 479 set_min_screenshot_interval(60000); | 479 set_min_screenshot_interval(60000); |
| 480 | 480 |
| 481 // Navigate again. This should not take any screenshot because of the | 481 // Navigate again. This should not take any screenshot because of the |
| 482 // increased screenshot interval. | 482 // increased screenshot interval. |
| 483 NavigationController::LoadURLParams params(navigations[0].url); | 483 NavigationController::LoadURLParams params(navigations[0].url); |
| 484 params.transition_type = PageTransitionFromInt(navigations[0].transition); | 484 params.transition_type = PageTransitionFromInt(navigations[0].transition); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 10); | 598 10); |
| 599 string16 actual_title = title_watcher.WaitAndGetTitle(); | 599 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 600 EXPECT_EQ(expected_title, actual_title); | 600 EXPECT_EQ(expected_title, actual_title); |
| 601 | 601 |
| 602 EXPECT_EQ(2, GetCurrentIndex()); | 602 EXPECT_EQ(2, GetCurrentIndex()); |
| 603 EXPECT_TRUE(controller.CanGoBack()); | 603 EXPECT_TRUE(controller.CanGoBack()); |
| 604 EXPECT_FALSE(controller.CanGoForward()); | 604 EXPECT_FALSE(controller.CanGoForward()); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace content | 607 } // namespace content |
| OLD | NEW |