Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: sandbox/win/src/file_policy_test.cc

Issue 854503002: Sandbox: Re-enable a test that should be working for a long time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 // denied since there is no wild card in the rule. 512 // denied since there is no wild card in the rule.
513 EXPECT_TRUE(runner.AddRuleSys32(TargetPolicy::FILES_ALLOW_DIR_ANY, L"")); 513 EXPECT_TRUE(runner.AddRuleSys32(TargetPolicy::FILES_ALLOW_DIR_ANY, L""));
514 runner.SetTestState(BEFORE_REVERT); 514 runner.SetTestState(BEFORE_REVERT);
515 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); 515 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace"));
516 516
517 runner.SetTestState(AFTER_REVERT); 517 runner.SetTestState(AFTER_REVERT);
518 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace")); 518 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"File_GetDiskSpace"));
519 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"File_Win32Create notepad.exe")); 519 EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(L"File_Win32Create notepad.exe"));
520 } 520 }
521 521
522 // http://crbug.com/146944 522 TEST(FilePolicyTest, TestReparsePoint) {
523 TEST(FilePolicyTest, DISABLED_TestReparsePoint) {
524 TestRunner runner; 523 TestRunner runner;
525 524
526 // Create a temp file because we need write access to it. 525 // Create a temp file because we need write access to it.
527 wchar_t temp_directory[MAX_PATH]; 526 wchar_t temp_directory[MAX_PATH];
528 wchar_t temp_file_name[MAX_PATH]; 527 wchar_t temp_file_name[MAX_PATH];
529 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u); 528 ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
530 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);
531 530
532 // Delete the file and create a directory instead. 531 // Delete the file and create a directory instead.
533 ASSERT_TRUE(::DeleteFile(temp_file_name)); 532 ASSERT_TRUE(::DeleteFile(temp_file_name));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 614
616 TEST(FilePolicyTest, CheckMissingNTPrefixEscape) { 615 TEST(FilePolicyTest, CheckMissingNTPrefixEscape) {
617 base::string16 name = L"C:\\NAME"; 616 base::string16 name = L"C:\\NAME";
618 617
619 base::string16 result = FixNTPrefixForMatch(name); 618 base::string16 result = FixNTPrefixForMatch(name);
620 619
621 EXPECT_STREQ(result.c_str(), L"\\/?/?\\C:\\NAME"); 620 EXPECT_STREQ(result.c_str(), L"\\/?/?\\C:\\NAME");
622 } 621 }
623 622
624 } // namespace sandbox 623 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698