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

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

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

Powered by Google App Engine
This is Rietveld 408576698