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

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

Issue 140783006: drive: Support authorizing third-party Drive apps for opening files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « google_apis/drive/drive_api_url_generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "google_apis/drive/drive_api_url_generator.h" 5 #include "google_apis/drive/drive_api_url_generator.h"
6 6
7 #include "google_apis/drive/test_util.h" 7 #include "google_apis/drive/test_util.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 url_generator_.GetFilesGetUrl("file:file_id").spec()); 58 url_generator_.GetFilesGetUrl("file:file_id").spec());
59 59
60 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/0ADK06pfg", 60 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/0ADK06pfg",
61 test_url_generator_.GetFilesGetUrl("0ADK06pfg").spec()); 61 test_url_generator_.GetFilesGetUrl("0ADK06pfg").spec());
62 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/0Bz0bd074", 62 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/0Bz0bd074",
63 test_url_generator_.GetFilesGetUrl("0Bz0bd074").spec()); 63 test_url_generator_.GetFilesGetUrl("0Bz0bd074").spec());
64 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/file%3Afile_id", 64 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files/file%3Afile_id",
65 test_url_generator_.GetFilesGetUrl("file:file_id").spec()); 65 test_url_generator_.GetFilesGetUrl("file:file_id").spec());
66 } 66 }
67 67
68 TEST_F(DriveApiUrlGeneratorTest, GetFilesAuthorizeUrl) {
69 EXPECT_EQ(
70 "https://www.googleapis.com/drive/v2internal/files/aa/authorize?appId=bb",
71 url_generator_.GetFilesAuthorizeUrl("aa", "bb").spec());
72 EXPECT_EQ(
73 "http://127.0.0.1:12345/drive/v2internal/files/foo/authorize?appId=bar",
74 test_url_generator_.GetFilesAuthorizeUrl("foo", "bar").spec());
75 }
76
68 TEST_F(DriveApiUrlGeneratorTest, GetFilesInsertUrl) { 77 TEST_F(DriveApiUrlGeneratorTest, GetFilesInsertUrl) {
69 EXPECT_EQ("https://www.googleapis.com/drive/v2/files", 78 EXPECT_EQ("https://www.googleapis.com/drive/v2/files",
70 url_generator_.GetFilesInsertUrl().spec()); 79 url_generator_.GetFilesInsertUrl().spec());
71 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files", 80 EXPECT_EQ("http://127.0.0.1:12345/drive/v2/files",
72 test_url_generator_.GetFilesInsertUrl().spec()); 81 test_url_generator_.GetFilesInsertUrl().spec());
73 } 82 }
74 83
75 TEST_F(DriveApiUrlGeneratorTest, GetFilePatchUrl) { 84 TEST_F(DriveApiUrlGeneratorTest, GetFilePatchUrl) {
76 struct TestPattern { 85 struct TestPattern {
77 bool set_modified_date; 86 bool set_modified_date;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 url_generator_.GenerateDownloadFileUrl("resourceId").spec()); 401 url_generator_.GenerateDownloadFileUrl("resourceId").spec());
393 EXPECT_EQ( 402 EXPECT_EQ(
394 "https://www.googledrive.com/host/file%3AresourceId", 403 "https://www.googledrive.com/host/file%3AresourceId",
395 url_generator_.GenerateDownloadFileUrl("file:resourceId").spec()); 404 url_generator_.GenerateDownloadFileUrl("file:resourceId").spec());
396 EXPECT_EQ( 405 EXPECT_EQ(
397 "http://127.0.0.1:12345/download/resourceId", 406 "http://127.0.0.1:12345/download/resourceId",
398 test_url_generator_.GenerateDownloadFileUrl("resourceId").spec()); 407 test_url_generator_.GenerateDownloadFileUrl("resourceId").spec());
399 } 408 }
400 409
401 } // namespace google_apis 410 } // namespace google_apis
OLDNEW
« no previous file with comments | « google_apis/drive/drive_api_url_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698