| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "chrome/browser/file_system/file_system_host_context.h" | 9 #include "chrome/browser/file_system/file_system_host_context.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 { FILE_PATH_LITERAL(":ab"), true, }, | 122 { FILE_PATH_LITERAL(":ab"), true, }, |
| 123 { FILE_PATH_LITERAL("?ab"), true, }, | 123 { FILE_PATH_LITERAL("?ab"), true, }, |
| 124 { FILE_PATH_LITERAL("|ab"), true, }, | 124 { FILE_PATH_LITERAL("|ab"), true, }, |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 } // namespace | 127 } // namespace |
| 128 | 128 |
| 129 class FileSystemHostContextTest : public testing::Test { | 129 class FileSystemHostContextTest : public testing::Test { |
| 130 public: | 130 public: |
| 131 FileSystemHostContextTest() | 131 FileSystemHostContextTest() |
| 132 : io_thread_(ChromeThread::IO, &message_loop_), | 132 : io_thread_(BrowserThread::IO, &message_loop_), |
| 133 data_path_(kTestDataPath) { | 133 data_path_(kTestDataPath) { |
| 134 } | 134 } |
| 135 | 135 |
| 136 void TearDown() { | 136 void TearDown() { |
| 137 message_loop_.RunAllPending(); | 137 message_loop_.RunAllPending(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 ~FileSystemHostContextTest() { | 140 ~FileSystemHostContextTest() { |
| 141 message_loop_.RunAllPending(); | 141 message_loop_.RunAllPending(); |
| 142 } | 142 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 TEST_F(FileSystemHostContextTest, IsRestrictedName) { | 204 TEST_F(FileSystemHostContextTest, IsRestrictedName) { |
| 205 scoped_refptr<FileSystemHostContext> context = GetHostContext(false); | 205 scoped_refptr<FileSystemHostContext> context = GetHostContext(false); |
| 206 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { | 206 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { |
| 207 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " | 207 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " |
| 208 << kIsRestrictedNameTestCases[i].name); | 208 << kIsRestrictedNameTestCases[i].name); |
| 209 FilePath name(kIsRestrictedNameTestCases[i].name); | 209 FilePath name(kIsRestrictedNameTestCases[i].name); |
| 210 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, | 210 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, |
| 211 context->IsRestrictedFileName(name)); | 211 context->IsRestrictedFileName(name)); |
| 212 } | 212 } |
| 213 } | 213 } |
| OLD | NEW |