OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/process/launch.h" | 11 #include "base/process/launch.h" |
12 #include "chrome/browser/file_select_helper.h" | 12 #include "chrome/browser/file_select_helper.h" |
13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 class FileSelectHelperTest : public testing::Test { | 16 class FileSelectHelperTest : public testing::Test { |
17 public: | 17 public: |
18 FileSelectHelperTest() {} | 18 FileSelectHelperTest() {} |
19 | 19 |
20 protected: | 20 protected: |
21 virtual void SetUp() override { | 21 void SetUp() override { |
22 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_)); | 22 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_)); |
23 data_dir_ = data_dir_.AppendASCII("file_select_helper"); | 23 data_dir_ = data_dir_.AppendASCII("file_select_helper"); |
24 ASSERT_TRUE(base::PathExists(data_dir_)); | 24 ASSERT_TRUE(base::PathExists(data_dir_)); |
25 } | 25 } |
26 | 26 |
27 // The path to input data used in tests. | 27 // The path to input data used in tests. |
28 base::FilePath data_dir_; | 28 base::FilePath data_dir_; |
29 | 29 |
30 private: | 30 private: |
31 DISALLOW_COPY_AND_ASSIGN(FileSelectHelperTest); | 31 DISALLOW_COPY_AND_ASSIGN(FileSelectHelperTest); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 size_t file_count = arraysize(files_to_verify); | 71 size_t file_count = arraysize(files_to_verify); |
72 for (size_t i = 0; i < file_count; i++) { | 72 for (size_t i = 0; i < file_count; i++) { |
73 const char* relative_path = files_to_verify[i]; | 73 const char* relative_path = files_to_verify[i]; |
74 base::FilePath orig_file = src.Append(relative_path); | 74 base::FilePath orig_file = src.Append(relative_path); |
75 base::FilePath final_file = | 75 base::FilePath final_file = |
76 temp_dir.path().Append(app_name).Append(relative_path); | 76 temp_dir.path().Append(app_name).Append(relative_path); |
77 EXPECT_TRUE(base::ContentsEqual(orig_file, final_file)); | 77 EXPECT_TRUE(base::ContentsEqual(orig_file, final_file)); |
78 } | 78 } |
79 } | 79 } |
80 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 80 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
OLD | NEW |