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

Side by Side Diff: chrome/browser/android/url_sanitize_utils_unittest.cc

Issue 646333002: Update EscapeExternalHandlerValue to keep '#', '[', and ']' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sanitize fragment and path Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 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/android/url_sanitize_utils.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace chrome {
10 namespace android {
11
12 class UrlSanitizeUtilsTest : public testing::Test {};
13
14 TEST_F(UrlSanitizeUtilsTest, SanitizeUrl) {
15 EXPECT_EQ("http://example.com/path%5B%5D/sub?q=a%7Cb%7Cc&q=1%7C2%7C3#ref%7C",
16 SanitizeUrl(GURL("http://example.com/path[]/"
17 "sub?q=a|b|c&q=1|2|3#ref|")).spec());
18
19 EXPECT_EQ("http://example.com/path%5B%5D/sub?q=a%7Cb%7Cc&q=1%7C2%7C3#ref%7C",
20 SanitizeUrl(GURL("http://example.com/path%5B%5D/"
21 "sub?q=a%7Cb%7Cc&q=1%7C2%7C3#ref%7C")).spec());
22
23 EXPECT_EQ("http://example.com/",
24 SanitizeUrl(GURL("http://example.com/")).spec());
25 }
26
27 } // namespace android
28 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698