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.
5 #include "google_apis/drive/gdata_wapi_url_generator.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/url_util.h"
11 namespace google_apis
{
13 class GDataWapiUrlGeneratorTest
: public testing::Test
{
15 GDataWapiUrlGeneratorTest()
17 GURL(GDataWapiUrlGenerator::kBaseUrlForProduction
)) {
21 GDataWapiUrlGenerator url_generator_
;
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());
30 TEST_F(GDataWapiUrlGeneratorTest
, GenerateEditUrl
) {
32 "https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
34 url_generator_
.GenerateEditUrl("XXX").spec());
37 TEST_F(GDataWapiUrlGeneratorTest
, GenerateEditUrlWithoutParams
) {
39 "https://docs.google.com/feeds/default/private/full/XXX",
40 url_generator_
.GenerateEditUrlWithoutParams("XXX").spec());
43 TEST_F(GDataWapiUrlGeneratorTest
, GenerateEditUrlWithEmbedOrigin
) {
44 url::AddStandardScheme("chrome-extension");
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(
51 GURL("chrome-extension://test")).spec());
53 "https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
55 url_generator_
.GenerateEditUrlWithEmbedOrigin(
60 } // namespace google_apis