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

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

Issue 10421008: Disable UnloadAviCapDllNoPatching because it is flaky. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« 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/src/sandbox.h" 6 #include "sandbox/src/sandbox.h"
7 #include "sandbox/src/sandbox_factory.h" 7 #include "sandbox/src/sandbox_factory.h"
8 #include "sandbox/src/target_services.h" 8 #include "sandbox/src/target_services.h"
9 #include "sandbox/tests/common/controller.h" 9 #include "sandbox/tests/common/controller.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 23 matching lines...) Expand all
34 // Opens an event passed as the first parameter of argv. 34 // Opens an event passed as the first parameter of argv.
35 SBOX_TESTS_COMMAND int SimpleOpenEvent(int argc, wchar_t **argv) { 35 SBOX_TESTS_COMMAND int SimpleOpenEvent(int argc, wchar_t **argv) {
36 if (argc != 1) 36 if (argc != 1)
37 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; 37 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND;
38 38
39 base::win::ScopedHandle event_open(::OpenEvent(SYNCHRONIZE, FALSE, argv[0])); 39 base::win::ScopedHandle event_open(::OpenEvent(SYNCHRONIZE, FALSE, argv[0]));
40 return event_open.Get() ? SBOX_TEST_SUCCEEDED : SBOX_TEST_FAILED; 40 return event_open.Get() ? SBOX_TEST_SUCCEEDED : SBOX_TEST_FAILED;
41 } 41 }
42 42
43 // Flaky on windows, see http://crbug.com/80569. 43 // Flaky on windows, see http://crbug.com/80569.
44 #if defined(OS_WIN) 44 TEST(UnloadDllTest, DISABLED_BaselineAvicapDll) {
45 #define MAYBE_BaselineAvicapDll DISABLED_BaselineAvicapDll
46 #else
47 #define MAYBE_BaselineAvicapDll BaselineAvicapDll
48 #endif
49 TEST(UnloadDllTest, MAYBE_BaselineAvicapDll) {
50 TestRunner runner; 45 TestRunner runner;
51 runner.SetTestState(BEFORE_REVERT); 46 runner.SetTestState(BEFORE_REVERT);
52 runner.SetTimeout(2000); 47 runner.SetTimeout(2000);
53 // Add a sync rule, because that ensures that the interception agent has 48 // Add a sync rule, because that ensures that the interception agent has
54 // more than one item in its internal table. 49 // more than one item in its internal table.
55 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC, 50 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC,
56 TargetPolicy::EVENTS_ALLOW_ANY, L"t0001")); 51 TargetPolicy::EVENTS_ALLOW_ANY, L"t0001"));
57 52
58 // Note for the puzzled: avicap32.dll is a 64-bit dll in 64-bit versions of 53 // Note for the puzzled: avicap32.dll is a 64-bit dll in 64-bit versions of
59 // windows so this test and the others just work. 54 // windows so this test and the others just work.
60 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"UseOneDLL L avicap32.dll")); 55 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"UseOneDLL L avicap32.dll"));
61 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"UseOneDLL B avicap32.dll")); 56 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"UseOneDLL B avicap32.dll"));
62 } 57 }
63 58
64 TEST(UnloadDllTest, FLAKY_UnloadAviCapDllNoPatching) { 59 // Flaky on windows, see http://crbug.com/80569.
60 TEST(UnloadDllTest, DISABLED_UnloadAviCapDllNoPatching) {
65 TestRunner runner; 61 TestRunner runner;
66 runner.SetTestState(BEFORE_REVERT); 62 runner.SetTestState(BEFORE_REVERT);
67 runner.SetTimeout(2000); 63 runner.SetTimeout(2000);
68 sandbox::TargetPolicy* policy = runner.GetPolicy(); 64 sandbox::TargetPolicy* policy = runner.GetPolicy();
69 policy->AddDllToUnload(L"avicap32.dll"); 65 policy->AddDllToUnload(L"avicap32.dll");
70 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"));
71 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"));
72 } 68 }
73 69
74 // Flaky: http://crbug.com/38404 70 // Flaky: http://crbug.com/38404
(...skipping 16 matching lines...) Expand all
91 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC, 87 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_SYNC,
92 TargetPolicy::EVENTS_ALLOW_ANY, L"tst0001")); 88 TargetPolicy::EVENTS_ALLOW_ANY, L"tst0001"));
93 89
94 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll")); 90 EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(L"UseOneDLL L avicap32.dll"));
95 91
96 runner.SetTestState(AFTER_REVERT); 92 runner.SetTestState(AFTER_REVERT);
97 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"SimpleOpenEvent tst0001")); 93 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"SimpleOpenEvent tst0001"));
98 } 94 }
99 95
100 } // namespace sandbox 96 } // 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