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

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

Issue 371883003: Files.app: Add an private API to get a download URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
OLDNEW
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 "google_apis/drive/drive_api_parser.h" 5 #include "google_apis/drive/drive_api_parser.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "google_apis/drive/gdata_wapi_parser.h" 9 #include "google_apis/drive/gdata_wapi_parser.h"
10 #include "google_apis/drive/test_util.h" 10 #include "google_apis/drive/test_util.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ASSERT_TRUE( 150 ASSERT_TRUE(
151 util::GetTimeFromString("2012-07-27T05:43:20.269Z", &modified_time)); 151 util::GetTimeFromString("2012-07-27T05:43:20.269Z", &modified_time));
152 EXPECT_EQ(modified_time, file1.modified_date()); 152 EXPECT_EQ(modified_time, file1.modified_date());
153 153
154 ASSERT_EQ(1U, file1.parents().size()); 154 ASSERT_EQ(1U, file1.parents().size());
155 EXPECT_EQ("0B4v7G8yEYAWHYW1OcExsUVZLABC", file1.parents()[0].file_id()); 155 EXPECT_EQ("0B4v7G8yEYAWHYW1OcExsUVZLABC", file1.parents()[0].file_id());
156 EXPECT_EQ(GURL("https://www.googleapis.com/drive/v2/files/" 156 EXPECT_EQ(GURL("https://www.googleapis.com/drive/v2/files/"
157 "0B4v7G8yEYAWHYW1OcExsUVZLABC"), 157 "0B4v7G8yEYAWHYW1OcExsUVZLABC"),
158 file1.parents()[0].parent_link()); 158 file1.parents()[0].parent_link());
159 159
160 EXPECT_EQ(GURL("https://www.example.com/download"), file1.download_url());
160 EXPECT_EQ("d41d8cd98f00b204e9800998ecf8427e", file1.md5_checksum()); 161 EXPECT_EQ("d41d8cd98f00b204e9800998ecf8427e", file1.md5_checksum());
161 EXPECT_EQ(1000U, file1.file_size()); 162 EXPECT_EQ(1000U, file1.file_size());
162 163
163 EXPECT_EQ(GURL("https://docs.google.com/file/d/" 164 EXPECT_EQ(GURL("https://docs.google.com/file/d/"
164 "0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit"), 165 "0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit"),
165 file1.alternate_link()); 166 file1.alternate_link());
166 ASSERT_EQ(1U, file1.open_with_links().size()); 167 ASSERT_EQ(1U, file1.open_with_links().size());
167 EXPECT_EQ("1234567890", file1.open_with_links()[0].app_id); 168 EXPECT_EQ("1234567890", file1.open_with_links()[0].app_id);
168 EXPECT_EQ(GURL("http://open_with_link/url"), 169 EXPECT_EQ(GURL("http://open_with_link/url"),
169 file1.open_with_links()[0].open_url); 170 file1.open_with_links()[0].open_url);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 test_util::LoadJSONFile("drive/filelist.json")); 264 test_util::LoadJSONFile("drive/filelist.json"));
264 265
265 EXPECT_TRUE(ChangeList::HasChangeListKind(*change_list_json)); 266 EXPECT_TRUE(ChangeList::HasChangeListKind(*change_list_json));
266 EXPECT_FALSE(ChangeList::HasChangeListKind(*file_list_json)); 267 EXPECT_FALSE(ChangeList::HasChangeListKind(*file_list_json));
267 268
268 EXPECT_FALSE(FileList::HasFileListKind(*change_list_json)); 269 EXPECT_FALSE(FileList::HasFileListKind(*change_list_json));
269 EXPECT_TRUE(FileList::HasFileListKind(*file_list_json)); 270 EXPECT_TRUE(FileList::HasFileListKind(*file_list_json));
270 } 271 }
271 272
272 } // namespace google_apis 273 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698