| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 NavEntryCommittedObserver nav_observer(web_contents()); | 332 NavEntryCommittedObserver nav_observer(web_contents()); |
| 333 if (successful_reload) | 333 if (successful_reload) |
| 334 Reload(); | 334 Reload(); |
| 335 else | 335 else |
| 336 FailedReload(); | 336 FailedReload(); |
| 337 | 337 |
| 338 // Ensures it is really handled a reload. | 338 // Ensures it is really handled a reload. |
| 339 const content::LoadCommittedDetails& nav_details = | 339 const content::LoadCommittedDetails& nav_details = |
| 340 nav_observer.load_committed_details(); | 340 nav_observer.load_committed_details(); |
| 341 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. | 341 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. |
| 342 EXPECT_EQ(content::NAVIGATION_TYPE_EXISTING_PAGE, nav_details.type); | 342 EXPECT_EQ(content::NavigationType::EXISTING_PAGE, nav_details.type); |
| 343 | 343 |
| 344 // The TranslateManager class processes the navigation entry committed | 344 // The TranslateManager class processes the navigation entry committed |
| 345 // notification in a posted task; process that task. | 345 // notification in a posted task; process that task. |
| 346 base::RunLoop().RunUntilIdle(); | 346 base::RunLoop().RunUntilIdle(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 TestRenderViewContextMenu* CreateContextMenu() { | 349 TestRenderViewContextMenu* CreateContextMenu() { |
| 350 content::ContextMenuParams params; | 350 content::ContextMenuParams params; |
| 351 params.media_type = blink::WebContextMenuData::MediaTypeNone; | 351 params.media_type = blink::WebContextMenuData::MediaTypeNone; |
| 352 params.x = 0; | 352 params.x = 0; |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 web_contents()->GetController().GetPendingEntry()->GetUniqueID(); | 930 web_contents()->GetController().GetPendingEntry()->GetUniqueID(); |
| 931 content::RenderFrameHostTester::For(web_contents()->GetMainFrame()) | 931 content::RenderFrameHostTester::For(web_contents()->GetMainFrame()) |
| 932 ->SendNavigateWithTransition(0, pending_id, false, url, | 932 ->SendNavigateWithTransition(0, pending_id, false, url, |
| 933 ui::PAGE_TRANSITION_TYPED); | 933 ui::PAGE_TRANSITION_TYPED); |
| 934 | 934 |
| 935 // Test that we are really getting a same page navigation, the test would be | 935 // Test that we are really getting a same page navigation, the test would be |
| 936 // useless if it was not the case. | 936 // useless if it was not the case. |
| 937 const content::LoadCommittedDetails& nav_details = | 937 const content::LoadCommittedDetails& nav_details = |
| 938 nav_observer.load_committed_details(); | 938 nav_observer.load_committed_details(); |
| 939 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. | 939 EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. |
| 940 EXPECT_EQ(content::NAVIGATION_TYPE_SAME_PAGE, nav_details.type); | 940 EXPECT_EQ(content::NavigationType::SAME_PAGE, nav_details.type); |
| 941 | 941 |
| 942 // The TranslateManager class processes the navigation entry committed | 942 // The TranslateManager class processes the navigation entry committed |
| 943 // notification in a posted task; process that task. | 943 // notification in a posted task; process that task. |
| 944 base::RunLoop().RunUntilIdle(); | 944 base::RunLoop().RunUntilIdle(); |
| 945 EXPECT_TRUE(CloseTranslateUi()); | 945 EXPECT_TRUE(CloseTranslateUi()); |
| 946 } | 946 } |
| 947 | 947 |
| 948 // Tests that a closed translate infobar does not reappear when navigating | 948 // Tests that a closed translate infobar does not reappear when navigating |
| 949 // in-page. | 949 // in-page. |
| 950 TEST_F(TranslateManagerRenderViewHostTest, CloseInfoBarInPageNavigation) { | 950 TEST_F(TranslateManagerRenderViewHostTest, CloseInfoBarInPageNavigation) { |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 | 1758 |
| 1759 // Check the bubble exists instead of the infobar. | 1759 // Check the bubble exists instead of the infobar. |
| 1760 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); | 1760 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); |
| 1761 ASSERT_TRUE(infobar == NULL); | 1761 ASSERT_TRUE(infobar == NULL); |
| 1762 TranslateBubbleModel* bubble = factory->model(); | 1762 TranslateBubbleModel* bubble = factory->model(); |
| 1763 ASSERT_TRUE(bubble != NULL); | 1763 ASSERT_TRUE(bubble != NULL); |
| 1764 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, | 1764 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, |
| 1765 bubble->GetViewState()); | 1765 bubble->GetViewState()); |
| 1766 } | 1766 } |
| 1767 #endif // defined(USE_AURA) | 1767 #endif // defined(USE_AURA) |
| OLD | NEW |