OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 #include <cctype> | 6 #include <cctype> |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <winioctl.h> | 9 #include <winioctl.h> |
10 | 10 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 // denied since there is no wild card in the rule. | 511 // denied since there is no wild card in the rule. |
512 EXPECT_TRUE(runner.AddRuleSys32(TargetPolicy::FILES_ALLOW_DIR_ANY, L"")); | 512 EXPECT_TRUE(runner.AddRuleSys32(TargetPolicy::FILES_ALLOW_DIR_ANY, L"")); |
513 runner.SetTestState(BEFORE_REVERT); | 513 runner.SetTestState(BEFORE_REVERT); |
514 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); | 514 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); |
515 | 515 |
516 runner.SetTestState(AFTER_REVERT); | 516 runner.SetTestState(AFTER_REVERT); |
517 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); | 517 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); |
518 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"File_Win32Create notepad.exe")); | 518 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"File_Win32Create notepad.exe")); |
519 } | 519 } |
520 | 520 |
521 TEST(FilePolicyTest, TestReparsePoint) { | 521 // http://crbug.com/146944 |
| 522 TEST(FilePolicyTest, DISABLED_TestReparsePoint) { |
522 TestRunner runner; | 523 TestRunner runner; |
523 | 524 |
524 // Create a temp file because we need write access to it. | 525 // Create a temp file because we need write access to it. |
525 wchar_t temp_directory[MAX_PATH]; | 526 wchar_t temp_directory[MAX_PATH]; |
526 wchar_t temp_file_name[MAX_PATH]; | 527 wchar_t temp_file_name[MAX_PATH]; |
527 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u); | 528 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u); |
528 ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0u); | 529 ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0u); |
529 | 530 |
530 // Delete the file and create a directory instead. | 531 // Delete the file and create a directory instead. |
531 ASSERT_TRUE(::DeleteFile(temp_file_name)); | 532 ASSERT_TRUE(::DeleteFile(temp_file_name)); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 EXPECT_TRUE(INVALID_HANDLE_VALUE != dir); | 590 EXPECT_TRUE(INVALID_HANDLE_VALUE != dir); |
590 EXPECT_TRUE(DeleteReparsePoint(dir)); | 591 EXPECT_TRUE(DeleteReparsePoint(dir)); |
591 EXPECT_TRUE(::CloseHandle(dir)); | 592 EXPECT_TRUE(::CloseHandle(dir)); |
592 | 593 |
593 // Cleanup. | 594 // Cleanup. |
594 EXPECT_TRUE(::DeleteFile(temp_file_in_temp.c_str())); | 595 EXPECT_TRUE(::DeleteFile(temp_file_in_temp.c_str())); |
595 EXPECT_TRUE(::RemoveDirectory(subfolder.c_str())); | 596 EXPECT_TRUE(::RemoveDirectory(subfolder.c_str())); |
596 } | 597 } |
597 | 598 |
598 } // namespace sandbox | 599 } // namespace sandbox |
OLD | NEW |