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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 GURL(kOrigin), storage::kFileSystemTypeNativeLocal, local_path); | 45 GURL(kOrigin), storage::kFileSystemTypeNativeLocal, local_path); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class FileHandlersMimeUtilTest : public testing::Test { | 50 class FileHandlersMimeUtilTest : public testing::Test { |
51 protected: | 51 protected: |
52 FileHandlersMimeUtilTest() {} | 52 FileHandlersMimeUtilTest() {} |
53 virtual ~FileHandlersMimeUtilTest() {} | 53 virtual ~FileHandlersMimeUtilTest() {} |
54 | 54 |
55 virtual void SetUp() OVERRIDE { | 55 virtual void SetUp() override { |
56 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 56 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
57 file_system_context_ = | 57 file_system_context_ = |
58 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); | 58 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); |
59 | 59 |
60 EXPECT_TRUE(base::CreateTemporaryFile(&html_mime_file_path_)); | 60 EXPECT_TRUE(base::CreateTemporaryFile(&html_mime_file_path_)); |
61 const std::string kSampleContent = "<html><body></body></html>"; | 61 const std::string kSampleContent = "<html><body></body></html>"; |
62 EXPECT_TRUE(base::WriteFile( | 62 EXPECT_TRUE(base::WriteFile( |
63 html_mime_file_path_, kSampleContent.c_str(), kSampleContent.size())); | 63 html_mime_file_path_, kSampleContent.c_str(), kSampleContent.size())); |
64 } | 64 } |
65 | 65 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 content::RunAllBlockingPoolTasksUntilIdle(); | 139 content::RunAllBlockingPoolTasksUntilIdle(); |
140 | 140 |
141 ASSERT_EQ(3u, result.size()); | 141 ASSERT_EQ(3u, result.size()); |
142 EXPECT_EQ("image/jpeg", result[0]); | 142 EXPECT_EQ("image/jpeg", result[0]); |
143 EXPECT_EQ("image/jpeg", result[1]); | 143 EXPECT_EQ("image/jpeg", result[1]); |
144 EXPECT_EQ("text/html", result[2]); | 144 EXPECT_EQ("text/html", result[2]); |
145 } | 145 } |
146 | 146 |
147 } // namespace app_file_handler_util | 147 } // namespace app_file_handler_util |
148 } // namespace extensions | 148 } // namespace extensions |
OLD | NEW |