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

Unified Diff: chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc

Issue 2668003004: Convert extensions::TabHelper to use the new navigation callbacks. (Closed)
Patch Set: update Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
index 44fcb66672e52e205c6582042081e97c0393e314..d9364e6106304d57fe367dcad0c66ce5b6736fc4 100644
--- a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
@@ -22,7 +22,7 @@
#include "components/bookmarks/browser/scoped_group_bookmark_actions.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
@@ -238,9 +238,10 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest,
// Navigate the first tab to a URL that we will bookmark.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://bookmarked/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ std::unique_ptr<content::NavigationHandle> navigation_handle =
+ content::NavigationHandle::CreateNavigationHandleForTesting(
+ GURL(), tabs[0]->GetMainFrame(), true);
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), false));
@@ -283,9 +284,10 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest, ExtensiveChanges) {
// Navigate the first tab to a URL that we will bookmark.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://bookmarked/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ std::unique_ptr<content::NavigationHandle> navigation_handle =
+ content::NavigationHandle::CreateNavigationHandleForTesting(
+ GURL(), tabs[0]->GetMainFrame(), true);
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), false));
@@ -386,9 +388,10 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest, Navigation) {
// Navigate the first tab to one bookmarked URL.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://bookmarked1/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ std::unique_ptr<content::NavigationHandle> navigation_handle =
+ content::NavigationHandle::CreateNavigationHandleForTesting(
+ GURL(), tabs[0]->GetMainFrame(), true);
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), true));
@@ -399,9 +402,7 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest, Navigation) {
// bookmarked state hasn't.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://bookmarked2/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), true));
@@ -410,9 +411,7 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest, Navigation) {
// Navigate the first tab to a non-bookmarked URL.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://not-bookmarked1/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), false));
@@ -423,9 +422,7 @@ TEST_F(DeclarativeContentIsBookmarkedConditionTrackerTest, Navigation) {
// bookmarked state hasn't.
delegate_.evaluation_requests().clear();
LoadURL(tabs[0].get(), GURL("http://not-bookmarked2/"));
- tracker_->OnWebContentsNavigation(tabs[0].get(),
- content::LoadCommittedDetails(),
- content::FrameNavigateParams());
+ tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get());
EXPECT_THAT(delegate_.evaluation_requests(),
UnorderedElementsAre(tabs[0].get()));
EXPECT_TRUE(CheckPredicates(tabs[0].get(), false));

Powered by Google App Engine
This is Rietveld 408576698