OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/safe_browsing/sandboxed_zip_analyzer.h" | 5 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "build/build_config.h" |
14 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/safe_browsing/zip_analyzer_results.h" | 17 #include "chrome/common/safe_browsing/zip_analyzer_results.h" |
16 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
17 #include "content/public/test/test_utils.h" | 19 #include "content/public/test/test_utils.h" |
18 #include "crypto/sha2.h" | 20 #include "crypto/sha2.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
20 | 22 |
21 namespace safe_browsing { | 23 namespace safe_browsing { |
22 | 24 |
23 class SandboxedZipAnalyzerTest : public ::testing::Test { | 25 class SandboxedZipAnalyzerTest : public ::testing::Test { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 RunAnalyzer(dir_test_data_.AppendASCII("zipfile_one_jse_file.zip"), &results); | 277 RunAnalyzer(dir_test_data_.AppendASCII("zipfile_one_jse_file.zip"), &results); |
276 ASSERT_TRUE(results.success); | 278 ASSERT_TRUE(results.success); |
277 EXPECT_TRUE(results.has_executable); | 279 EXPECT_TRUE(results.has_executable); |
278 EXPECT_FALSE(results.has_archive); | 280 EXPECT_FALSE(results.has_archive); |
279 ASSERT_EQ(1, results.archived_binary.size()); | 281 ASSERT_EQ(1, results.archived_binary.size()); |
280 ExpectBinary(kJSEFile, results.archived_binary.Get(0)); | 282 ExpectBinary(kJSEFile, results.archived_binary.Get(0)); |
281 EXPECT_TRUE(results.archived_archive_filenames.empty()); | 283 EXPECT_TRUE(results.archived_archive_filenames.empty()); |
282 } | 284 } |
283 | 285 |
284 } // namespace safe_browsing | 286 } // namespace safe_browsing |
OLD | NEW |