| 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/arc_navigation_throttle.h" | 5 #include "chrome/browser/chromeos/arc/arc_navigation_throttle.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "url/gurl.h" | 7 #include "url/gurl.h" |
| 8 | 8 |
| 9 namespace arc { | 9 namespace arc { |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( | 29 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 30 GURL("http://a.google.com/"), GURL())); | 30 GURL("http://a.google.com/"), GURL())); |
| 31 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( | 31 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 32 GURL(), GURL())); | 32 GURL(), GURL())); |
| 33 | 33 |
| 34 // A navigation not within the same domain can be overridden. | 34 // A navigation not within the same domain can be overridden. |
| 35 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( | 35 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 36 GURL("http://www.google.com"), GURL("http://www.not-google.com/"))); | 36 GURL("http://www.google.com"), GURL("http://www.not-google.com/"))); |
| 37 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( | 37 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 38 GURL("http://www.not-google.com"), GURL("http://www.google.com/"))); | 38 GURL("http://www.not-google.com"), GURL("http://www.google.com/"))); |
| 39 |
| 40 // A navigation with neither an http nor https scheme cannot be overriden. |
| 41 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 42 GURL("chrome-extension://fake_document"), GURL("http://www.a.com"))); |
| 43 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 44 GURL("http://www.a.com"), GURL("chrome-extension://fake_document"))); |
| 45 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 46 GURL("chrome-extension://fake_document"), GURL("https://www.a.com"))); |
| 47 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 48 GURL("https://www.a.com"), GURL("chrome-extension://fake_document"))); |
| 49 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting( |
| 50 GURL("chrome-extension://fake_a"), GURL("chrome-extension://fake_b"))); |
| 39 } | 51 } |
| 40 | 52 |
| 41 } // namespace arc | 53 } // namespace arc |
| OLD | NEW |