| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/json/json_file_value_serializer.h" | 7 #include "base/json/json_file_value_serializer.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 TEST_F(GDataParserTest, AccountMetadataFeedParser) { | 311 TEST_F(GDataParserTest, AccountMetadataFeedParser) { |
| 312 scoped_ptr<Value> document(LoadJSONFile("account_metadata.json")); | 312 scoped_ptr<Value> document(LoadJSONFile("account_metadata.json")); |
| 313 ASSERT_TRUE(document.get()); | 313 ASSERT_TRUE(document.get()); |
| 314 ASSERT_EQ(Value::TYPE_DICTIONARY, document->GetType()); | 314 ASSERT_EQ(Value::TYPE_DICTIONARY, document->GetType()); |
| 315 DictionaryValue* entry_value = NULL; | 315 DictionaryValue* entry_value = NULL; |
| 316 ASSERT_TRUE(reinterpret_cast<DictionaryValue*>(document.get())->GetDictionary( | 316 ASSERT_TRUE(reinterpret_cast<DictionaryValue*>(document.get())->GetDictionary( |
| 317 std::string("entry"), &entry_value)); | 317 std::string("entry"), &entry_value)); |
| 318 ASSERT_TRUE(entry_value); | 318 ASSERT_TRUE(entry_value); |
| 319 | 319 |
| 320 scoped_ptr<AccountMetadataFeed> feed( | 320 scoped_ptr<AccountMetadataFeed> feed( |
| 321 AccountMetadataFeed::CreateFrom(*document)); | 321 AccountMetadataFeed::CreateFrom(*document, false)); |
| 322 ASSERT_TRUE(feed.get()); | 322 ASSERT_TRUE(feed.get()); |
| 323 EXPECT_EQ(GG_LONGLONG(6789012345), feed->quota_bytes_used()); | 323 EXPECT_EQ(GG_LONGLONG(6789012345), feed->quota_bytes_used()); |
| 324 EXPECT_EQ(GG_LONGLONG(9876543210), feed->quota_bytes_total()); | 324 EXPECT_EQ(GG_LONGLONG(9876543210), feed->quota_bytes_total()); |
| 325 EXPECT_EQ(654321, feed->largest_changestamp()); | 325 EXPECT_EQ(654321, feed->largest_changestamp()); |
| 326 EXPECT_EQ(2U, feed->installed_apps().size()); | 326 EXPECT_EQ(2U, feed->installed_apps().size()); |
| 327 const InstalledApp* first_app = feed->installed_apps()[0]; | 327 const InstalledApp* first_app = feed->installed_apps()[0]; |
| 328 const InstalledApp* second_app = feed->installed_apps()[1]; | 328 const InstalledApp* second_app = feed->installed_apps()[1]; |
| 329 | 329 |
| 330 IF_EXPECT_TRUE(first_app) { | 330 IF_EXPECT_TRUE(first_app) { |
| 331 EXPECT_EQ("Drive App 1", UTF16ToUTF8(first_app->app_name())); | 331 EXPECT_EQ("Drive App 1", UTF16ToUTF8(first_app->app_name())); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 FilePath(FILE_PATH_LITERAL("Test.tar.gz")))); | 393 FilePath(FILE_PATH_LITERAL("Test.tar.gz")))); |
| 394 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( | 394 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( |
| 395 FilePath(FILE_PATH_LITERAL("Test.txt")))); | 395 FilePath(FILE_PATH_LITERAL("Test.txt")))); |
| 396 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( | 396 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( |
| 397 FilePath(FILE_PATH_LITERAL("Test")))); | 397 FilePath(FILE_PATH_LITERAL("Test")))); |
| 398 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( | 398 EXPECT_FALSE(DocumentEntry::HasHostedDocumentExtension( |
| 399 FilePath(FILE_PATH_LITERAL("")))); | 399 FilePath(FILE_PATH_LITERAL("")))); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace gdata | 402 } // namespace gdata |
| OLD | NEW |