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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ", expected_file = " << expected_file_name.AsUTF8Unsafe(); | 140 ", expected_file = " << expected_file_name.AsUTF8Unsafe(); |
141 } | 141 } |
142 | 142 |
143 void SetUpOnMainThread() override { | 143 void SetUpOnMainThread() override { |
144 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 144 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
145 save_dir_ = temp_dir_.GetPath(); | 145 save_dir_ = temp_dir_.GetPath(); |
146 temp_sub_resource_dir_ = save_dir_.AppendASCII("sub_resource_files"); | 146 temp_sub_resource_dir_ = save_dir_.AppendASCII("sub_resource_files"); |
147 | 147 |
148 BrowserThread::PostTask( | 148 BrowserThread::PostTask( |
149 BrowserThread::IO, FROM_HERE, | 149 BrowserThread::IO, FROM_HERE, |
150 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 150 base::BindOnce(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
151 } | 151 } |
152 | 152 |
153 base::ScopedTempDir temp_dir_; | 153 base::ScopedTempDir temp_dir_; |
154 base::FilePath save_dir_; | 154 base::FilePath save_dir_; |
155 base::FilePath temp_sub_resource_dir_; | 155 base::FilePath temp_sub_resource_dir_; |
156 }; | 156 }; |
157 | 157 |
158 // TODO(jnd): 1. Some encodings are missing here. It'll be added later. See | 158 // TODO(jnd): 1. Some encodings are missing here. It'll be added later. See |
159 // http://crbug.com/13306. | 159 // http://crbug.com/13306. |
160 // 2. Add more files with multiple encoding name variants for each canonical | 160 // 2. Add more files with multiple encoding name variants for each canonical |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 // Dump the page, the content of dump page should be equal with our expect | 271 // Dump the page, the content of dump page should be equal with our expect |
272 // result file. | 272 // result file. |
273 base::FilePath expected_result_file_name = | 273 base::FilePath expected_result_file_name = |
274 base::FilePath().AppendASCII(kAutoDetectDir). | 274 base::FilePath().AppendASCII(kAutoDetectDir). |
275 AppendASCII(kExpectedResultDir). | 275 AppendASCII(kExpectedResultDir). |
276 AppendASCII(kTestDatas[i].expected_result); | 276 AppendASCII(kTestDatas[i].expected_result); |
277 SaveAndCompare(kTestDatas[i].test_file_name, expected_result_file_name); | 277 SaveAndCompare(kTestDatas[i].test_file_name, expected_result_file_name); |
278 } | 278 } |
279 } | 279 } |
OLD | NEW |