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

Unified Diff: chrome/browser/extensions/api/declarative_content/declarative_content_css_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_css_condition_tracker_unittest.cc
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc
index d183f57760a912a5678fd853d490cb4ca3e63e50..c55157e9095a90546e0a0bba1532f6db7c687b88 100644
--- a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc
@@ -11,7 +11,7 @@
#include "base/test/values_test_util.h"
#include "chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h"
#include "chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_test.h"
-#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h"
#include "extensions/common/extension_messages.h"
@@ -301,10 +301,10 @@ TEST_F(DeclarativeContentCssConditionTrackerTest, Navigation) {
// Check that an in-page navigation has no effect on the matching selectors.
{
- content::LoadCommittedDetails details;
- details.is_in_page = true;
- content::FrameNavigateParams params;
- tracker_.OnWebContentsNavigation(tab.get(), details, params);
+ std::unique_ptr<content::NavigationHandle> navigation_handle =
+ content::NavigationHandle::CreateNavigationHandleForTesting(
+ GURL(), tab->GetMainFrame(), true, net::OK, true);
+ tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get());
EXPECT_TRUE(tracker_.EvaluatePredicate(predicate.get(), tab.get()));
EXPECT_EQ(expected_evaluation_requests, delegate_.evaluation_requests());
}
@@ -312,10 +312,10 @@ TEST_F(DeclarativeContentCssConditionTrackerTest, Navigation) {
// Check that a non in-page navigation clears the matching selectors and
// requests condition evaluation.
{
- content::LoadCommittedDetails details;
- details.is_in_page = false;
- content::FrameNavigateParams params;
- tracker_.OnWebContentsNavigation(tab.get(), details, params);
+ std::unique_ptr<content::NavigationHandle> navigation_handle =
+ content::NavigationHandle::CreateNavigationHandleForTesting(
+ GURL(), tab->GetMainFrame(), true);
+ tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get());
EXPECT_FALSE(tracker_.EvaluatePredicate(predicate.get(), tab.get()));
EXPECT_EQ(++expected_evaluation_requests, delegate_.evaluation_requests());
}

Powered by Google App Engine
This is Rietveld 408576698