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

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: 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
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 auto url_and_query = GetBaseURLAndQuery(url);
15 EXPECT_EQ(url_and_query.first, url);
16 EXPECT_EQ(url_and_query.second, "");
17 }
18
19 TEST(QueryUtil, WithEmptyQuery) {
20 GURL url("http://www.example.com/?");
21 auto url_and_query = GetBaseURLAndQuery(url);
22 EXPECT_EQ(url_and_query.first, GURL("http://www.example.com/"));
23 EXPECT_EQ(url_and_query.second, "?");
24 }
25
26 TEST(QueryUtil, WithFullQuery) {
27 GURL url("http://www.example.com/?a=b&c=d");
28 auto url_and_query = GetBaseURLAndQuery(url);
29 EXPECT_EQ(url_and_query.first, GURL("http://www.example.com/"));
30 EXPECT_EQ(url_and_query.second, "?a=b&c=d");
31 }
32
33 TEST(QueryUtil, ForFileURL) {
34 GURL url("file:///tmp/file?a=b&c=d");
35 auto url_and_query = GetBaseURLAndQuery(url);
36 EXPECT_EQ(url_and_query.first, GURL("file:///tmp/file"));
37 EXPECT_EQ(url_and_query.second, "?a=b&c=d");
38 }
39
40 } // namespace shell
41 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698