| 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/extensions/api/file_handlers/mime_util.h" | 5 #include "chrome/browser/extensions/api/file_handlers/mime_util.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 class FileHandlersMimeUtilTest : public testing::Test { | 51 class FileHandlersMimeUtilTest : public testing::Test { |
| 52 protected: | 52 protected: |
| 53 FileHandlersMimeUtilTest() {} | 53 FileHandlersMimeUtilTest() {} |
| 54 ~FileHandlersMimeUtilTest() override {} | 54 ~FileHandlersMimeUtilTest() override {} |
| 55 | 55 |
| 56 void SetUp() override { | 56 void SetUp() override { |
| 57 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 57 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 58 file_system_context_ = | 58 file_system_context_ = |
| 59 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); | 59 content::CreateFileSystemContextForTesting(NULL, data_dir_.GetPath()); |
| 60 | 60 |
| 61 EXPECT_TRUE(base::CreateTemporaryFile(&html_mime_file_path_)); | 61 EXPECT_TRUE(base::CreateTemporaryFile(&html_mime_file_path_)); |
| 62 const std::string kSampleContent = "<html><body></body></html>"; | 62 const std::string kSampleContent = "<html><body></body></html>"; |
| 63 EXPECT_TRUE(base::WriteFile( | 63 EXPECT_TRUE(base::WriteFile( |
| 64 html_mime_file_path_, kSampleContent.c_str(), kSampleContent.size())); | 64 html_mime_file_path_, kSampleContent.c_str(), kSampleContent.size())); |
| 65 } | 65 } |
| 66 | 66 |
| 67 content::TestBrowserThreadBundle thread_bundle_; | 67 content::TestBrowserThreadBundle thread_bundle_; |
| 68 TestingProfile profile_; | 68 TestingProfile profile_; |
| 69 scoped_refptr<storage::FileSystemContext> file_system_context_; | 69 scoped_refptr<storage::FileSystemContext> file_system_context_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 content::RunAllBlockingPoolTasksUntilIdle(); | 140 content::RunAllBlockingPoolTasksUntilIdle(); |
| 141 | 141 |
| 142 ASSERT_EQ(3u, result.size()); | 142 ASSERT_EQ(3u, result.size()); |
| 143 EXPECT_EQ("image/jpeg", result[0]); | 143 EXPECT_EQ("image/jpeg", result[0]); |
| 144 EXPECT_EQ("image/jpeg", result[1]); | 144 EXPECT_EQ("image/jpeg", result[1]); |
| 145 EXPECT_EQ("text/html", result[2]); | 145 EXPECT_EQ("text/html", result[2]); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace app_file_handler_util | 148 } // namespace app_file_handler_util |
| 149 } // namespace extensions | 149 } // namespace extensions |
| OLD | NEW |