Chromium Code Reviews| 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" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/chromeos/gdata/gdata_parser.h" | 13 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
| 14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/libxml/chromium/libxml_utils.h" | 16 #include "third_party/libxml/chromium/libxml_utils.h" |
| 17 | 17 |
| 18 using base::Value; | 18 using base::Value; |
| 19 using base::DictionaryValue; | 19 using base::DictionaryValue; |
| 20 using base::ListValue; | 20 using base::ListValue; |
| 21 | 21 |
| 22 #define IF_EXPECT_EQ(arg1, arg2) \ | 22 #define IF_EXPECT_EQ(arg1, arg2) \ |
| 23 EXPECT_EQ(arg1, arg2); \ | 23 EXPECT_EQ(arg1, arg2); \ |
| 24 if (arg1 == arg2) | 24 if (arg1 == arg2) |
| 25 | 25 |
| 26 #define IF_EXPECT_TRUE(arg) \ | 26 #define IF_EXPECT_TRUE(arg) \ |
| 27 EXPECT_TRUE(arg); \ | 27 EXPECT_TRUE(arg); \ |
| 28 if (arg) | 28 if (arg) |
| 29 | 29 |
| 30 namespace gdata { | 30 namespace gdata { |
| 31 | 31 |
| 32 class GDataParserTest : public testing::Test { | 32 class GDataParserTest : public testing::Test { |
|
hashimoto
2012/07/11 06:03:08
Could you rename this too?
kochi
2012/07/11 06:26:32
Done.
| |
| 33 protected: | 33 protected: |
| 34 static Value* LoadJSONFile(const std::string& filename) { | 34 static Value* LoadJSONFile(const std::string& filename) { |
| 35 FilePath path; | 35 FilePath path; |
| 36 std::string error; | 36 std::string error; |
| 37 // Test files for this unit test are located in | 37 // Test files for this unit test are located in |
| 38 // src/chrome/test/data/chromeos/gdata/* | 38 // src/chrome/test/data/chromeos/gdata/* |
| 39 PathService::Get(chrome::DIR_TEST_DATA, &path); | 39 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 40 path = path.AppendASCII("chromeos") | 40 path = path.AppendASCII("chromeos") |
| 41 .AppendASCII("gdata") | 41 .AppendASCII("gdata") |
| 42 .AppendASCII(filename.c_str()); | 42 .AppendASCII(filename.c_str()); |
| (...skipping 350 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 |