Hide the sign-in/out button in about:settings for supervised users.
[chromium-blink-merge.git] / google_apis / drive / gdata_wapi_url_generator_unittest.cc
blob0ac8508d774fd9e7ea056d53fd3d27f86618c8be
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"
8 #include "url/gurl.h"
9 #include "url/url_util.h"
11 namespace google_apis {
13 class GDataWapiUrlGeneratorTest : public testing::Test {
14 public:
15 GDataWapiUrlGeneratorTest()
16 : url_generator_(
17 GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) {
20 protected:
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) {
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());
37 TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrlWithoutParams) {
38 EXPECT_EQ(
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");
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());
60 } // namespace google_apis