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

Side by Side Diff: chrome/browser/translate/translate_manager_render_view_host_unittest.cc

Issue 636673002: Remove navigation from TestRenderViewHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from self-review Created 6 years, 2 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 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 #include <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 GURL url("http://www.google.fr"); 833 GURL url("http://www.google.fr");
834 SimulateNavigation(url, "fr", true); 834 SimulateNavigation(url, "fr", true);
835 835
836 EXPECT_TRUE(CloseTranslateInfoBar()); 836 EXPECT_TRUE(CloseTranslateInfoBar());
837 837
838 // Create a pending navigation and simulate a page load. That should be the 838 // Create a pending navigation and simulate a page load. That should be the
839 // equivalent of typing the URL again in the location bar. 839 // equivalent of typing the URL again in the location bar.
840 NavEntryCommittedObserver nav_observer(web_contents()); 840 NavEntryCommittedObserver nav_observer(web_contents());
841 web_contents()->GetController().LoadURL( 841 web_contents()->GetController().LoadURL(
842 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); 842 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
843 rvh_tester()->SendNavigateWithTransition( 843 content::RenderFrameHostTester::For(web_contents()->GetMainFrame())
844 0, url, ui::PAGE_TRANSITION_TYPED); 844 ->SendNavigateWithTransition(0, url, ui::PAGE_TRANSITION_TYPED);
845 845
846 // Test that we are really getting a same page navigation, the test would be 846 // Test that we are really getting a same page navigation, the test would be
847 // useless if it was not the case. 847 // useless if it was not the case.
848 const content::LoadCommittedDetails& nav_details = 848 const content::LoadCommittedDetails& nav_details =
849 nav_observer.load_committed_details(); 849 nav_observer.load_committed_details();
850 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. 850 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation.
851 EXPECT_EQ(content::NAVIGATION_TYPE_SAME_PAGE, nav_details.type); 851 EXPECT_EQ(content::NAVIGATION_TYPE_SAME_PAGE, nav_details.type);
852 852
853 // The TranslateManager class processes the navigation entry committed 853 // The TranslateManager class processes the navigation entry committed
854 // notification in a posted task; process that task. 854 // notification in a posted task; process that task.
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 menu->ExecuteCommand(IDC_CONTENT_CONTEXT_TRANSLATE, 0); 1671 menu->ExecuteCommand(IDC_CONTENT_CONTEXT_TRANSLATE, 0);
1672 1672
1673 // Check the bubble exists instead of the infobar. 1673 // Check the bubble exists instead of the infobar.
1674 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); 1674 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar();
1675 ASSERT_TRUE(infobar == NULL); 1675 ASSERT_TRUE(infobar == NULL);
1676 TranslateBubbleModel* bubble = factory->model(); 1676 TranslateBubbleModel* bubble = factory->model();
1677 ASSERT_TRUE(bubble != NULL); 1677 ASSERT_TRUE(bubble != NULL);
1678 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, 1678 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING,
1679 bubble->GetViewState()); 1679 bubble->GetViewState());
1680 } 1680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698