| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |