| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/drive/drive_api_util.h" | 5 #include "chrome/browser/drive/drive_api_util.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/md5.h" | 8 #include "base/md5.h" |
| 9 #include "chrome/browser/google_apis/drive_api_parser.h" | 9 #include "google_apis/drive/drive_api_parser.h" |
| 10 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 10 #include "google_apis/drive/gdata_wapi_parser.h" |
| 11 #include "chrome/browser/google_apis/test_util.h" | 11 #include "google_apis/drive/test_util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace drive { | 15 namespace drive { |
| 16 namespace util { | 16 namespace util { |
| 17 | 17 |
| 18 TEST(DriveApiUtilTest, EscapeQueryStringValue) { | 18 TEST(DriveApiUtilTest, EscapeQueryStringValue) { |
| 19 EXPECT_EQ("abcde", EscapeQueryStringValue("abcde")); | 19 EXPECT_EQ("abcde", EscapeQueryStringValue("abcde")); |
| 20 EXPECT_EQ("\\'", EscapeQueryStringValue("'")); | 20 EXPECT_EQ("\\'", EscapeQueryStringValue("'")); |
| 21 EXPECT_EQ("\\'abcde\\'", EscapeQueryStringValue("'abcde'")); | 21 EXPECT_EQ("\\'abcde\\'", EscapeQueryStringValue("'abcde'")); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 base::FilePath path = temp_dir.path().AppendASCII("test.txt"); | 323 base::FilePath path = temp_dir.path().AppendASCII("test.txt"); |
| 324 const char kTestData[] = "abcdefghijklmnopqrstuvwxyz0123456789"; | 324 const char kTestData[] = "abcdefghijklmnopqrstuvwxyz0123456789"; |
| 325 ASSERT_TRUE(google_apis::test_util::WriteStringToFile(path, kTestData)); | 325 ASSERT_TRUE(google_apis::test_util::WriteStringToFile(path, kTestData)); |
| 326 | 326 |
| 327 EXPECT_EQ(base::MD5String(kTestData), GetMd5Digest(path)); | 327 EXPECT_EQ(base::MD5String(kTestData), GetMd5Digest(path)); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace util | 330 } // namespace util |
| 331 } // namespace drive | 331 } // namespace drive |
| OLD | NEW |