| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 6 | 6 |
| 7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace google_apis { | 10 namespace google_apis { |
| 11 | 11 |
| 12 class GDataWapiUrlGeneratorTest : public testing::Test { | 12 class GDataWapiUrlGeneratorTest : public testing::Test { |
| 13 public: | 13 public: |
| 14 GDataWapiUrlGeneratorTest() | 14 GDataWapiUrlGeneratorTest() |
| 15 : url_generator_(GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) { | 15 : url_generator_(GURL(GDataWapiUrlGenerator::kBaseUrlForProduction)) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 protected: | 18 protected: |
| 19 GDataWapiUrlGenerator url_generator_; | 19 GDataWapiUrlGenerator url_generator_; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 TEST_F(GDataWapiUrlGeneratorTest, GetBaseUrlForTesting) { | |
| 23 EXPECT_EQ("http://127.0.0.1:12345/", | |
| 24 GDataWapiUrlGenerator::GetBaseUrlForTesting(12345).spec()); | |
| 25 } | |
| 26 | |
| 27 TEST_F(GDataWapiUrlGeneratorTest, AddStandardUrlParams) { | 22 TEST_F(GDataWapiUrlGeneratorTest, AddStandardUrlParams) { |
| 28 EXPECT_EQ("http://www.example.com/?v=3&alt=json", | 23 EXPECT_EQ("http://www.example.com/?v=3&alt=json", |
| 29 GDataWapiUrlGenerator::AddStandardUrlParams( | 24 GDataWapiUrlGenerator::AddStandardUrlParams( |
| 30 GURL("http://www.example.com")).spec()); | 25 GURL("http://www.example.com")).spec()); |
| 31 } | 26 } |
| 32 | 27 |
| 33 TEST_F(GDataWapiUrlGeneratorTest, AddMetadataUrlParams) { | 28 TEST_F(GDataWapiUrlGeneratorTest, AddMetadataUrlParams) { |
| 34 EXPECT_EQ("http://www.example.com/?v=3&alt=json&include-installed-apps=true", | 29 EXPECT_EQ("http://www.example.com/?v=3&alt=json&include-installed-apps=true", |
| 35 GDataWapiUrlGenerator::AddMetadataUrlParams( | 30 GDataWapiUrlGenerator::AddMetadataUrlParams( |
| 36 GURL("http://www.example.com")).spec()); | 31 GURL("http://www.example.com")).spec()); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 158 } |
| 164 | 159 |
| 165 TEST_F(GDataWapiUrlGeneratorTest, GenerateAccountMetadataUrl) { | 160 TEST_F(GDataWapiUrlGeneratorTest, GenerateAccountMetadataUrl) { |
| 166 EXPECT_EQ( | 161 EXPECT_EQ( |
| 167 "https://docs.google.com/feeds/metadata/default" | 162 "https://docs.google.com/feeds/metadata/default" |
| 168 "?v=3&alt=json&include-installed-apps=true", | 163 "?v=3&alt=json&include-installed-apps=true", |
| 169 url_generator_.GenerateAccountMetadataUrl().spec()); | 164 url_generator_.GenerateAccountMetadataUrl().spec()); |
| 170 } | 165 } |
| 171 | 166 |
| 172 } // namespace google_apis | 167 } // namespace google_apis |
| OLD | NEW |