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

Side by Side 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, 1 month 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog .h" 5 #include "chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog .h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace arc { 10 namespace arc {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 std::pair<GURL, std::string> url_and_package; 424 std::pair<GURL, std::string> url_and_package;
425 // GetAction shouldn't return OPEN_URL_IN_CHROME because Chrome doesn't 425 // GetAction shouldn't return OPEN_URL_IN_CHROME because Chrome doesn't
426 // directly support geo:. 426 // directly support geo:.
427 EXPECT_EQ(GetActionResult::HANDLE_URL_IN_ARC, 427 EXPECT_EQ(GetActionResult::HANDLE_URL_IN_ARC,
428 GetActionForTesting(intent_url_with_fallback, handlers, 428 GetActionForTesting(intent_url_with_fallback, handlers,
429 no_selection, &url_and_package)); 429 no_selection, &url_and_package));
430 EXPECT_EQ(geo_url, url_and_package.first); 430 EXPECT_EQ(geo_url, url_and_package.first);
431 EXPECT_EQ(kChromePackageName, url_and_package.second); 431 EXPECT_EQ(kChromePackageName, url_and_package.second);
432 } 432 }
433 433
434 // Test that ShouldIgnoreNavigation accepts CLIENT_REDIRECT qualifier but does
435 // not other ones.
436 TEST(ArcExternalProtocolDialogTest, TestShouldIgnoreNavigation) {
437 EXPECT_FALSE(ShouldIgnoreNavigationForTesting(
438 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK)));
439 EXPECT_FALSE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
440 ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_CLIENT_REDIRECT)));
441 EXPECT_TRUE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
442 ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_CLIENT_REDIRECT |
443 ui::PAGE_TRANSITION_HOME_PAGE)));
444 EXPECT_TRUE(ShouldIgnoreNavigationForTesting(ui::PageTransitionFromInt(
445 ui::PAGE_TRANSITION_LINK | ui::PAGE_TRANSITION_HOME_PAGE)));
446 }
447
434 } // namespace arc 448 } // namespace arc
OLDNEW
« 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