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

Unified Diff: chrome_frame/test/test_scrubber.h

Issue 9460019: Reduce flakiness in chrome_frame_tests.exe by having each run in a clean environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed compile break Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/run_all_unittests.cc ('k') | chrome_frame/test/test_scrubber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/test_scrubber.h
diff --git a/chrome_frame/test/test_scrubber.h b/chrome_frame/test/test_scrubber.h
new file mode 100644
index 0000000000000000000000000000000000000000..da870efe61f22474823eb47725149c05de1a6907
--- /dev/null
+++ b/chrome_frame/test/test_scrubber.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// The test scrubber cleans up machine state between tests. This includes
+// killing all Internet Explorer processes, killing all Chrome processes spawned
+// by Chrome Frame, and deleting the user data directory. The scrubber must be
+// installed before tests are run via |InstallTestScrubber|.
+//
+// Tests that lead to Chrome using a user data directory other than that used by
+// Chrome Frame in IE must provide that directory to the scrubber via
+// |OverrideDataDirectoryForThisTest()|. Failure to do so will lead to the
+// scrubber failing to delete that directory.
+
+#ifndef CHROME_FRAME_TEST_TEST_SCRUBBER_H_
+#define CHROME_FRAME_TEST_TEST_SCRUBBER_H_
+#pragma once
+
+#include "base/string_piece.h"
+
+namespace testing {
+class UnitTest;
+}
+
+namespace chrome_frame_test {
+
+// Install the scrubber in |unit_test| (call before RUN_ALL_TESTS).
+void InstallTestScrubber(testing::UnitTest* unit_test);
+
+// Override the user data directory that will be deleted by the scrubber at the
+// completion of the current test.
+void OverrideDataDirectoryForThisTest(const base::StringPiece16& user_data_dir);
+
+} // namespace chrome_frame_test
+
+#endif // CHROME_FRAME_TEST_TEST_SCRUBBER_H_
« no previous file with comments | « chrome_frame/test/run_all_unittests.cc ('k') | chrome_frame/test/test_scrubber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698