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

Unified Diff: chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc

Issue 2449213006: Factor out ShouldIgnoreNavigation and add tests for the function (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc
diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc b/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc
index 06824e3e7209152fcadfa07646abfa1458017a02..8001672f3ecd330531f6a63a9d40a9c22e20232c 100644
--- a/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc
+++ b/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog_unittest.cc
@@ -431,4 +431,18 @@ TEST(ArcExternalProtocolDialogTest, TestGetActionWithGeoUrlAsFallback) {
EXPECT_EQ(kChromePackageName, url_and_package.second);
}
+// Test that ShouldIgnoreNavigation accepts CLIENT_REDIRECT qualifier but does
+// not other ones.
+TEST(ArcExternalProtocolDialogTest, TestShouldIgnoreNavigation) {
+ EXPECT_FALSE(ShouldIgnoreNavigationForTesting(
+ ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK)));
+ EXPECT_FALSE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_CLIENT_REDIRECT)));
+ EXPECT_TRUE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_CLIENT_REDIRECT |
+ ui::PAGE_TRANSITION_HOME_PAGE)));
+ EXPECT_TRUE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_HOME_PAGE)));
+}
+
} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698