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

Side by Side Diff: google_apis/drive/gdata_wapi_url_generator_unittest.cc

Issue 861133002: Remove WAPI-related code, except the type definition of ResourceEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review comments. Created 5 years, 11 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 | « google_apis/drive/gdata_wapi_url_generator.cc ('k') | google_apis/drive/test_util.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 (c) 2012 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 "google_apis/drive/gdata_wapi_url_generator.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h"
9 #include "url/url_util.h"
10
11 namespace google_apis {
12
13 class GDataWapiUrlGeneratorTest : public testing::Test {
14 public:
15 GDataWapiUrlGeneratorTest()
16 : url_generator_(
17 GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) {
18 }
19
20 protected:
21 GDataWapiUrlGenerator url_generator_;
22 };
23
24 TEST_F(GDataWapiUrlGeneratorTest, AddStandardUrlParams) {
25 EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true",
26 GDataWapiUrlGenerator::AddStandardUrlParams(
27 GURL("http://www.example.com")).spec());
28 }
29
30 TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrl) {
31 EXPECT_EQ(
32 "https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
33 "&showroot=true",
34 url_generator_.GenerateEditUrl("XXX").spec());
35 }
36
37 TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrlWithoutParams) {
38 EXPECT_EQ(
39 "https://docs.google.com/feeds/default/private/full/XXX",
40 url_generator_.GenerateEditUrlWithoutParams("XXX").spec());
41 }
42
43 TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrlWithEmbedOrigin) {
44 url::AddStandardScheme("chrome-extension");
45
46 EXPECT_EQ(
47 "https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
48 "&showroot=true&embedOrigin=chrome-extension%3A%2F%2Ftest",
49 url_generator_.GenerateEditUrlWithEmbedOrigin(
50 "XXX",
51 GURL("chrome-extension://test")).spec());
52 EXPECT_EQ(
53 "https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
54 "&showroot=true",
55 url_generator_.GenerateEditUrlWithEmbedOrigin(
56 "XXX",
57 GURL()).spec());
58 }
59
60 } // namespace google_apis
OLDNEW
« no previous file with comments | « google_apis/drive/gdata_wapi_url_generator.cc ('k') | google_apis/drive/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698