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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura_browsertest.cc

Issue 23022006: Remove GetActiveEntry usage from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698