OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/logging.h" | |
8 #include "chrome/browser/download/download_manager.h" | 7 #include "chrome/browser/download/download_manager.h" |
9 #include "chrome/browser/download/download_util.h" | 8 #include "chrome/browser/download/download_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 class DownloadManagerTest : public testing::Test { | 11 class DownloadManagerTest : public testing::Test { |
13 public: | 12 public: |
14 DownloadManagerTest() { | 13 DownloadManagerTest() { |
15 download_manager_ = new DownloadManager(); | 14 download_manager_ = new DownloadManager(); |
16 download_util::InitializeExeTypes(&download_manager_->exe_types_); | 15 download_util::InitializeExeTypes(&download_manager_->exe_types_); |
17 } | 16 } |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } // namespace | 377 } // namespace |
379 | 378 |
380 TEST_F(DownloadManagerTest, GetSafeFilename) { | 379 TEST_F(DownloadManagerTest, GetSafeFilename) { |
381 for (int i = 0; i < arraysize(kSafeFilenameCases); ++i) { | 380 for (int i = 0; i < arraysize(kSafeFilenameCases); ++i) { |
382 FilePath path(kSafeFilenameCases[i].path); | 381 FilePath path(kSafeFilenameCases[i].path); |
383 download_manager_->GenerateSafeFilename(kSafeFilenameCases[i].mime_type, | 382 download_manager_->GenerateSafeFilename(kSafeFilenameCases[i].mime_type, |
384 &path); | 383 &path); |
385 EXPECT_EQ(kSafeFilenameCases[i].expected_path, path.value()); | 384 EXPECT_EQ(kSafeFilenameCases[i].expected_path, path.value()); |
386 } | 385 } |
387 } | 386 } |
OLD | NEW |