summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/test_scrubber.h
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 15:28:57 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 15:28:57 +0000
commitb8f8723b5e2a7da9fdd5e22f4f13c4f0f267624c (patch)
treefca8a1b9378df7da34a2c370af6b5d180f5bf387 /chrome_frame/test/test_scrubber.h
parent270961e1c438b1045f9ea6dd131d90f57d41ce44 (diff)
downloadchromium_src-b8f8723b5e2a7da9fdd5e22f4f13c4f0f267624c.zip
chromium_src-b8f8723b5e2a7da9fdd5e22f4f13c4f0f267624c.tar.gz
chromium_src-b8f8723b5e2a7da9fdd5e22f4f13c4f0f267624c.tar.bz2
Reduce flakiness in chrome_frame_tests.exe by having each test run in a clean environment.
This includes: * A TestScrubber runs between all test to kill stray IE and Chrome processes and delete the user data dir. * Refactored CFACWithChrome and ProxyFactoryTest tests to get rid of copy-n-paste. * Tests in ChromeFrameTestWithWebServer that launch Chrome now use a fresh user data dir so as not to collide with a users' existing profile. BUG=81479,114386 TEST=chrome_frame_tests.exe is green on the win_cf trybot Review URL: https://chromiumcodereview.appspot.com/9460019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/test_scrubber.h')
-rw-r--r--chrome_frame/test/test_scrubber.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome_frame/test/test_scrubber.h b/chrome_frame/test/test_scrubber.h
new file mode 100644
index 0000000..da870ef
--- /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_