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

Side by Side Diff: shell/application_manager/query_util_unittest.cc

Issue 972473003: Strip query string before applying url mapping. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 9 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 | « shell/application_manager/query_util.cc ('k') | shell/url_resolver.cc » ('j') | 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 2015 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 "shell/application_manager/query_util.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace mojo {
10 namespace {
11
12 TEST(QueryUtil, NoQuery) {
13 GURL url("http://www.example.com/");
14 std::string query;
15 GURL base_url = GetBaseURLAndQuery(url, &query);
16 EXPECT_EQ(base_url, url);
17 EXPECT_EQ(query, "");
18 }
19
20 TEST(QueryUtil, WithEmptyQuery) {
21 GURL url("http://www.example.com/?");
22 std::string query;
23 GURL base_url = GetBaseURLAndQuery(url, &query);
24 EXPECT_EQ(base_url, GURL("http://www.example.com/"));
25 EXPECT_EQ(query, "?");
26 }
27
28 TEST(QueryUtil, WithFullQuery) {
29 GURL url("http://www.example.com/?a=b&c=d");
30 std::string query;
31 GURL base_url = GetBaseURLAndQuery(url, &query);
32 EXPECT_EQ(base_url, GURL("http://www.example.com/"));
33 EXPECT_EQ(query, "?a=b&c=d");
34 }
35
36 TEST(QueryUtil, ForFileURL) {
37 GURL url("file:///tmp/file?a=b&c=d");
38 std::string query;
39 GURL base_url = GetBaseURLAndQuery(url, &query);
40 EXPECT_EQ(base_url, GURL("file:///tmp/file"));
41 EXPECT_EQ(query, "?a=b&c=d");
42 }
43
44 } // namespace shell
45 } // namespace
OLDNEW
« no previous file with comments | « shell/application_manager/query_util.cc ('k') | shell/url_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698