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

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

Issue 1299503002: Sandbox: Reenable test that was flaking for being too slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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) 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/win/scoped_handle.h" 5 #include "base/win/scoped_handle.h"
6 #include "sandbox/win/src/sandbox.h" 6 #include "sandbox/win/src/sandbox.h"
7 #include "sandbox/win/src/sandbox_factory.h" 7 #include "sandbox/win/src/sandbox_factory.h"
8 #include "sandbox/win/src/target_services.h" 8 #include "sandbox/win/src/target_services.h"
9 #include "sandbox/win/tests/common/controller.h" 9 #include "sandbox/win/tests/common/controller.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 TEST(UnloadDllTest, DISABLED_UnloadAviCapDllNoPatching) { 60 TEST(UnloadDllTest, DISABLED_UnloadAviCapDllNoPatching) {
61 TestRunner runner; 61 TestRunner runner;
62 runner.SetTestState(BEFORE_REVERT); 62 runner.SetTestState(BEFORE_REVERT);
63 runner.SetTimeout(2000); 63 runner.SetTimeout(2000);
64 sandbox::TargetPolicy* policy = runner.GetPolicy(); 64 sandbox::TargetPolicy* policy = runner.GetPolicy();
65 policy->AddDllToUnload(L"avicap32.dll"); 65 policy->AddDllToUnload(L"avicap32.dll");
66 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll")); 66 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll"));
67 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL B avicap32.dll")); 67 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL B avicap32.dll"));
68 } 68 }
69 69
70 // Flaky: http://crbug.com/38404 70 TEST(UnloadDllTest, UnloadAviCapDllWithPatching) {
71 TEST(UnloadDllTest, DISABLED_UnloadAviCapDllWithPatching) {
72 TestRunner runner; 71 TestRunner runner;
73 runner.SetTimeout(2000); 72 runner.SetTimeout(2000);
74 runner.SetTestState(BEFORE_REVERT); 73 runner.SetTestState(BEFORE_REVERT);
75 sandbox::TargetPolicy* policy = runner.GetPolicy(); 74 sandbox::TargetPolicy* policy = runner.GetPolicy();
76 policy->AddDllToUnload(L"avicap32.dll"); 75 policy->AddDllToUnload(L"avicap32.dll");
77 76
78 base::win::ScopedHandle handle1(::CreateEvent( 77 base::win::ScopedHandle handle1(::CreateEvent(
79 NULL, FALSE, FALSE, L"tst0001")); 78 NULL, FALSE, FALSE, L"tst0001"));
80 79
81 // Add a couple of rules that ensures that the interception agent add EAT 80 // Add a couple of rules that ensures that the interception agent add EAT
82 // patching on the client which makes sure that the unload dll record does 81 // patching on the client which makes sure that the unload dll record does
83 // not interact badly with them. 82 // not interact badly with them.
84 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_REGISTRY, 83 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_REGISTRY,
85 TargetPolicy::REG_ALLOW_ANY, 84 TargetPolicy::REG_ALLOW_ANY,
86 L"HKEY_LOCAL_MACHINE\\Software\\Microsoft")); 85 L"HKEY_LOCAL_MACHINE\\Software\\Microsoft"));
87 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC, 86 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC,
88 TargetPolicy::EVENTS_ALLOW_ANY, L"tst0001")); 87 TargetPolicy::EVENTS_ALLOW_ANY, L"tst0001"));
89 88
90 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll")); 89 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll"));
91 90
92 runner.SetTestState(AFTER_REVERT); 91 runner.SetTestState(AFTER_REVERT);
93 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"SimpleOpenEvent tst0001")); 92 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"SimpleOpenEvent tst0001"));
94 } 93 }
95 94
96 } // namespace sandbox 95 } // 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