| 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 "google_apis/drive/gdata_wapi_parser.h" | 5 #include "google_apis/drive/gdata_wapi_parser.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 ASSERT_TRUE(document.get()); | 241 ASSERT_TRUE(document.get()); |
| 242 base::DictionaryValue* document_dict = NULL; | 242 base::DictionaryValue* document_dict = NULL; |
| 243 base::DictionaryValue* entry_value = NULL; | 243 base::DictionaryValue* entry_value = NULL; |
| 244 ASSERT_TRUE(document->GetAsDictionary(&document_dict)); | 244 ASSERT_TRUE(document->GetAsDictionary(&document_dict)); |
| 245 ASSERT_TRUE(document_dict->GetDictionary(std::string("entry"), &entry_value)); | 245 ASSERT_TRUE(document_dict->GetDictionary(std::string("entry"), &entry_value)); |
| 246 ASSERT_TRUE(entry_value); | 246 ASSERT_TRUE(entry_value); |
| 247 | 247 |
| 248 scoped_ptr<AccountMetadata> metadata( | 248 scoped_ptr<AccountMetadata> metadata( |
| 249 AccountMetadata::CreateFrom(*document)); | 249 AccountMetadata::CreateFrom(*document)); |
| 250 ASSERT_TRUE(metadata.get()); | 250 ASSERT_TRUE(metadata.get()); |
| 251 EXPECT_EQ(GG_LONGLONG(6789012345), metadata->quota_bytes_used()); | 251 EXPECT_EQ(6789012345LL, metadata->quota_bytes_used()); |
| 252 EXPECT_EQ(GG_LONGLONG(9876543210), metadata->quota_bytes_total()); | 252 EXPECT_EQ(9876543210LL, metadata->quota_bytes_total()); |
| 253 EXPECT_EQ(654321, metadata->largest_changestamp()); | 253 EXPECT_EQ(654321, metadata->largest_changestamp()); |
| 254 EXPECT_EQ(2U, metadata->installed_apps().size()); | 254 EXPECT_EQ(2U, metadata->installed_apps().size()); |
| 255 const InstalledApp* first_app = metadata->installed_apps()[0]; | 255 const InstalledApp* first_app = metadata->installed_apps()[0]; |
| 256 const InstalledApp* second_app = metadata->installed_apps()[1]; | 256 const InstalledApp* second_app = metadata->installed_apps()[1]; |
| 257 | 257 |
| 258 ASSERT_TRUE(first_app); | 258 ASSERT_TRUE(first_app); |
| 259 EXPECT_EQ("Drive App 1", first_app->app_name()); | 259 EXPECT_EQ("Drive App 1", first_app->app_name()); |
| 260 EXPECT_EQ("Drive App Object 1", first_app->object_type()); | 260 EXPECT_EQ("Drive App Object 1", first_app->object_type()); |
| 261 EXPECT_TRUE(first_app->supports_create()); | 261 EXPECT_TRUE(first_app->supports_create()); |
| 262 EXPECT_EQ("https://chrome.google.com/webstore/detail/abcdefabcdef", | 262 EXPECT_EQ("https://chrome.google.com/webstore/detail/abcdefabcdef", |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_EXTERNAL_APP)); | 378 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_EXTERNAL_APP)); |
| 379 EXPECT_EQ(ResourceEntry::KIND_OF_FOLDER, | 379 EXPECT_EQ(ResourceEntry::KIND_OF_FOLDER, |
| 380 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_FOLDER)); | 380 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_FOLDER)); |
| 381 EXPECT_EQ(ResourceEntry::KIND_OF_FILE, | 381 EXPECT_EQ(ResourceEntry::KIND_OF_FILE, |
| 382 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_FILE)); | 382 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_FILE)); |
| 383 EXPECT_EQ(ResourceEntry::KIND_OF_FILE, | 383 EXPECT_EQ(ResourceEntry::KIND_OF_FILE, |
| 384 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_PDF)); | 384 ResourceEntry::ClassifyEntryKind(ENTRY_KIND_PDF)); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace google_apis | 387 } // namespace google_apis |
| OLD | NEW |