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

Side by Side Diff: chrome/browser/chromeos/arc/arc_navigation_throttle_unittest.cc

Issue 2277533002: Open |current_url| in Chrome when |previous_url| is empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Xiyuan's comment Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_navigation_throttle.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/arc/arc_navigation_throttle.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "url/gurl.h"
8
9 namespace arc {
10
11 TEST(ArcNavigationThrottleTest, TestShouldOverrideUrlLoading) {
12 // A navigation within the same domain shouldn't be overridden.
13 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
14 GURL("http://google.com"), GURL("http://google.com/")));
15 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
16 GURL("http://google.com"), GURL("http://a.google.com/")));
17 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
18 GURL("http://a.google.com"), GURL("http://google.com/")));
19 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
20 GURL("http://a.google.com"), GURL("http://b.google.com/")));
21 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
22 GURL("http://a.google.com"), GURL("http://b.c.google.com/")));
23 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
24 GURL("http://a.b.google.com"), GURL("http://c.google.com/")));
25
26 // If either of two paramters is empty, the function should return false.
27 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
28 GURL(), GURL("http://a.google.com/")));
29 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
30 GURL("http://a.google.com/"), GURL()));
31 EXPECT_FALSE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
32 GURL(), GURL()));
33
34 // A navigation not within the same domain can be overridden.
35 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
36 GURL("http://www.google.com"), GURL("http://www.not-google.com/")));
37 EXPECT_TRUE(ArcNavigationThrottle::ShouldOverrideUrlLoadingForTesting(
38 GURL("http://www.not-google.com"), GURL("http://www.google.com/")));
39 }
40
41 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_navigation_throttle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698